标题:有一個錯幫忙看一下我連的是ACCESS數據庫
只看楼主
jxyga111
Rank: 8Rank: 8
来 自:中華人民共和國
等 级:贵宾
威 望:33
帖 子:6015
专家分:895
注 册:2008-3-21
结帖率:70%
 问题点数:0 回复次数:0 
有一個錯幫忙看一下我連的是ACCESS數據庫
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')
搜索更多相关主题的帖子: MSF 计沮畐 ACCESS strField objcase 
2008-06-24 17:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-220973-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.062715 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved