下面的代码用于连接到sharepoint列表并删除“代码列”值与“值”匹配的行,我能否将下面代码中的“值”更改为单元格引用,如[a1]?怎样?
视频代码源:https://www.youtube.com/watch?v=uwrvldfaapq&list=plo0amptfifdrcpiwbqjgb3qt3rkomjdbn&index=5
Sub allTst_SharePoint()
Dim mySQL As String
Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim xuser As String
Dim xactivity As String
Dim xtimesince As Date
Set cnt = New ADODB.Connection
Set rst = New ADODB.Recordset
mySQL = "Delete * FROM [mylist] WHERE [Code] = 'VALUE' ;"
With cnt
.ConnectionString = _
"Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=0;RetrieveIds=Yes;DATABASE=mySPsite;LIST={myguid};"
.Open
End With
cnt.Execute mySQL, , adCmdText
If CBool(rst.State And adStateOpen) = True Then rst.Close
Set rst = Nothing
If CBool(cnt.State And adStateOpen) = True Then cnt.Close
Set cnt = Nothing
End Sub
1条答案
按热度按时间vulvrdjw1#
尝试