注册 登录
编程论坛 ACCESS论坛

有一個錯幫忙看一下我連的是ACCESS數據庫

jxyga111 发布于 2008-06-24 17:09, 1476 次点击
Dim objcase As New ADODB.Recordset
                objcn.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')
0 回复
1