刷新联接表的函数
时间:2006-11-24 23:58 来源:ACCESS设计在线 作者:想不通 阅读:次
Public Sub Tablsx(Strtext As String) '刷新联连表,参数为联接表的址及文件名,USYS_Tabl是存放联接表名的表。
Dim hdk As String
Dim cat As ADOX.Catalog
Dim tdf As ADOX.Table
hdk = Strtext
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
Dim db As ADODB.Connection
Dim rs As Recordset
Dim BIAO As String
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
rs.ActiveConnection = CurrentProject.Connection
rs.Open "USYS_Tabl", , adOpenKeyset, adLockOptimistic, adCmdTable
rs.MoveFirst
Do Until rs.EOF
BIAO = rs!id
Set tdf = cat.Tables(BIAO)
tdf.Properties("jet oledb:link datasource") = hdk
rs.MoveNext
Loop
rs.Close
DoCmd.Close
End Sub
**************************
全部表都是联接表时用
Public Sub Ffff(strtext As String)
Dim cat As ADOX.Catalog
Dim tdf As ADOX.Table
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
For I = 6 To cat.Tables.count
Set tdf = cat.Tables(I)
tdf.Properties("jet oledb:link datasource") = strtext
Next I
End Sub
Dim hdk As String
Dim cat As ADOX.Catalog
Dim tdf As ADOX.Table
hdk = Strtext
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
Dim db As ADODB.Connection
Dim rs As Recordset
Dim BIAO As String
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
rs.ActiveConnection = CurrentProject.Connection
rs.Open "USYS_Tabl", , adOpenKeyset, adLockOptimistic, adCmdTable
rs.MoveFirst
Do Until rs.EOF
BIAO = rs!id
Set tdf = cat.Tables(BIAO)
tdf.Properties("jet oledb:link datasource") = hdk
rs.MoveNext
Loop
rs.Close
DoCmd.Close
End Sub
**************************
全部表都是联接表时用
Public Sub Ffff(strtext As String)
Dim cat As ADOX.Catalog
Dim tdf As ADOX.Table
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
For I = 6 To cat.Tables.count
Set tdf = cat.Tables(I)
tdf.Properties("jet oledb:link datasource") = strtext
Next I
End Sub
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
相关内容
- ·如何将数据表导出备份到excel表格
- ·在表中用组合框选择备选项目
- ·如何设置表的Caption和Description属性
- ·用Access实现学校课程表的科学管理
- ·在表中设置美元等货币符号的方法
- ·Access建表需注意的问题(建表原则)
- ·Access获取表下个自动增加的ID值【两种
- ·Access光标在文本框的右边
- ·Access格式、掩码、文本有效性的异同
- ·access中的掩码
- ·【技巧】Access时间函数汇总(一)
- ·Access隐藏表中的列
- ·Excel与Access简便联系方法
- ·Word文本文件导入到Access2007与导出的
- ·ACCESS字段中设置默认日期值函数大全
- ·ACCESS的真假:三、往一个表中插入10万
最新内容
推荐内容