VBscript 中 RecordSet 对象的更新函数导致 DBISAM 解析错误

发布于 2024-07-11 15:29:17 字数 1061 浏览 9 评论 0原文

使用 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"

我无法弄清楚是什么导致了此错误。 有谁对造成这种情况的原因有任何想法吗?

I'm having difficulty using the Update function on a RecordSet object while using the DBISAM 4 ODBC driver. Here is what my code looks like.

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 

When I try to execute this code I receive the following error:

"DBISAM Engine Error #11949 SQL Parsing error- Expected ( but instead found = in UPDATE SQL statement at line 1, column 336"

I can't figure out what is causing this error. Does anyone have any ideas as to what is causing it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无妨# 2024-07-18 15:29:17

DBISAM 错误消息 检查字段名称。

DBISAM error messages Check the field name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文