有一個錯幫忙看一下
Dim objcase As New ADODB.Recordsetobjcn.Execute "delete from t_jb where id = '" & MSF.TextMatrix(MSF.Row, 0) & "' "
objcase.Open "select id,name,dept,zw,price,zt from t_jb where id='" & MSF.TextMatrix(MSF.Rows - 1, 0) & "' ", objcn, 3, 2
For i = 1 To MSF.Rows - 1
strField = "": strValues = ""
For j = 0 To MSF.Cols - 1
strField = strField & objcase.Fields(j).Name & ","
Select Case j
Case Else
strValues = strValues & "'" & Replace(MSF.TextMatrix(i, j), "'", "''") & "'" & ","
End Select
Next
strField = Left(strField, Len(strField) - 1)
strValues = Left(strValues, Len(strValues) - 1)
objcn.Execute "insert into t_jb (" & strField & ") values (" & strValues & ")"
Next
objcn.Execute "insert into t_jb (" & strField & ") values (" & strValues & ")"
說這句的陳述式語法錯誤
結果是這樣的+
insert into t_jb(id,name,dept,zw,price,zt,date) values ('12','2','1','3','4','5','2008/6/24')