У меня нижеприведенный vba, и я получаю сообщение об ошибке с неверным синтаксисом рядом с.
Private Sub uplodblanks()
Dim ssql, r, c, con, dstring
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim lRow
con = "Provider=SQLOLEDB;Password=0wcwlZq7hVeiu#S&bt;User ID=clx_write; Initial
Catalog=DPEDataMartDBPrd01; Data Source=tcp:dscusnoramcloroxprd01.database.windows.net,1433;"
r = 1
c = 1
Worksheets("WTUpload").Calculate
'For i = 1 To 18
'dstring = dstring & "'" & Sheets("WTUpload").Cells(5, i) & "' , "
'Next i
'dstring = dstring & "'" & Sheets("WTUpload").Cells(5, 19) & "'"
lRow = Cells.Find(What:="*", After:=Range("A1"), LookAt:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False).Row
cn.Open con
i = 1
For i = 1 To lRow
ssql = "update dbo.cxu_all_load_control set driver_arr_dte = " & Sheets("WTUpload").Cells(i, 11) & " where mst_ship_num = " & Sheets("WTUpload").Cells(i, 11) & " ; "
cn.Execute ssql
Next i
cn.Close
End Sub