在使用DBISAM 4 ODBC驱动程序时,我在使用RecordSet对象上的Update函数时遇到了困难。这是我的代码的样子。
dtmNewDate = DateSerial(1997, 2, 3)
MsgBox(dtmNewDate)
'Create connection object & connection string
Set AConnection = CreateObject("ADODB.Connection")
strConnection = "Driver={DBISAM 4 ODBC Driver}; CatalogName=S:\RAPID\Z998\2008; ReadOnly=False"
Aconnection.Mode = adModeReadWrite
AConnection.Open strConnection
'create SQL statement to be run in order to populate the recordset
strSQLEmployeeBDate = "SELECT * FROM Z998EMPL WHERE state = 'NY'"
'Create Recordset object
Set rsRecSet = CreateObject("ADODB.Recordset")
rsRecSet.LockType = 2
rsRecSet.Open strSQLEmployeeBDate, AConnection
While Not rsRecSet.EOF
rsRecSet.Fields("BIRTHDATE").value = dtmNewDate
rsRecSet.Update
rsRecSet.MoveNext
Wend
当我尝试执行此代码时,收到以下错误:
"DBISAM Engine Error #11949 SQL Parsing error- Expected ( but instead found = in UPDATE SQL statement at line 1, column 336"
我无法弄清楚导致此错误的原因。有没有人对导致它的原因有任何想法?