通过excel vba刷新访问数据库中的sharepoint链表

时间:2017-03-01 19:13:40

标签: excel vba excel-vba

我正在尝试使用excel vba刷新访问数据库中的sharepoint链表。 我在excel vba中创建了访问数据库的连接

 On Error GoTo ExceptionHandle
 Dim cn As ADODB.Connection, rs As ADODB.Recordset

' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=C:\sample.accdb;"      
' open a recordset
Set rs = New ADODB.Recordset

但我如何使用方法CurrentDb.TableDefs(“TableName”)。RefreshLink。如何使用cn指定currentdb。

1 个答案:

答案 0 :(得分:0)

我认为ADODB不支持CurrentDb方法,但DAO支持。

相关问题