我希望能够在 excel 中创建一个 adodb 记录集,我可以根据需要循环进行添加/编辑等。以下创建记录集,但在最后一行引发错误 (80004005)“无法连接到 SharePoint 网站。稍后再试”:
strLURL = "<SharePoint list URL>"
strGUID = "{D16F31E9-41F3-4193-8926-35FFC0714C86}"
intIMEX = 1
strList = "Planner"
strConn = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;"
strConn = strConn & "IMEX=" & intIMEX & ";"
strConn = strConn & "RetrieveIds=Yes;"
strConn = strConn & "DATABASE=" & strLURL & ";"
strConn = strConn & "LIST=" & strGUID & ";"
strConn = strConn & "VIEW=; RetrieveIds=Yes;"
strConn = strConn & "Table = " & strList
Dim cnCur As New ADODB.Connection
Dim rsCur As New ADODB.Recordset
Dim strSQL As String
cnCur.Open ConnectionString:=strConn
strSQL = "SELECT * FROM [" & strList & "]"
rsCur.Open Source:=strSQL, ActiveConnection:=cnCur