选项值已更改 - ODBC 错误 2169
感谢您的回复。
我使用 Powerbasic (www.powerbasic.com) 作为编译器,使用 SQLTools 作为第三方工具通过 ODBC 访问 ADS。 我必须指出,当我执行更新、删除、查找等其他操作时,也会出现此错误。但我不这样做 当我使用 MS Access 时出现此错误。
这是我的保存程序:
Local sUsername As String
Local sPassword As String
Local sStatus As String
Local sSQLStatement1 As String
sUsername = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_TXTUSERNAME)
If Trim$(sUsername) = "" Then
MsgBox "Please, enter Username", %MB_ICONINFORMATION Or %MB_TASKMODAL, VD_App.Title
Control Set Focus nCbHndl, %ID_FRMUPDATEUSERS_TXTUSERNAME
Exit Function
End If
sPassword = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_TXTPASSWORD)
If Trim$(sPassword) = "" Then
MsgBox "Please, enter Password", %MB_ICONINFORMATION Or %MB_TASKMODAL, VD_App.Title
Control Set Focus nCbHndl, %ID_FRMUPDATEUSERS_TXTPASSWORD
Exit Function
End If
sStatus = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_CBOSTATUS)
sSQLStatement1 = "INSERT INTO [tblUsers] (Username, Password, Status) " + _
"VALUES ('" + sUsername + "','" + sPassword + "','" + sStatus +"')"
'Submit the SQL Statement to the database
SQL_Stmt %SQL_STMT_IMMEDIATE, sSQLStatement1
'Check for errors
If SQL_ErrorPending Then
SQL_MsgBox SQL_ErrorQuickAll, %MSGBOX_OK
End If
最好的问候,
Thank you for your response.
I am using Powerbasic (www.powerbasic.com) as my compiler and SQLTools as a third party tool to access ADS through ODBC.
I must stat that this error also appers when I take other actions like Update, Delete, Find, etc. But I don't
get this error when I am using MS Access.
Here is my save routine:
Local sUsername As String
Local sPassword As String
Local sStatus As String
Local sSQLStatement1 As String
sUsername = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_TXTUSERNAME)
If Trim$(sUsername) = "" Then
MsgBox "Please, enter Username", %MB_ICONINFORMATION Or %MB_TASKMODAL, VD_App.Title
Control Set Focus nCbHndl, %ID_FRMUPDATEUSERS_TXTUSERNAME
Exit Function
End If
sPassword = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_TXTPASSWORD)
If Trim$(sPassword) = "" Then
MsgBox "Please, enter Password", %MB_ICONINFORMATION Or %MB_TASKMODAL, VD_App.Title
Control Set Focus nCbHndl, %ID_FRMUPDATEUSERS_TXTPASSWORD
Exit Function
End If
sStatus = VD_GetText (nCbHndl, %ID_FRMUPDATEUSERS_CBOSTATUS)
sSQLStatement1 = "INSERT INTO [tblUsers] (Username, Password, Status) " + _
"VALUES ('" + sUsername + "','" + sPassword + "','" + sStatus +"')"
'Submit the SQL Statement to the database
SQL_Stmt %SQL_STMT_IMMEDIATE, sSQLStatement1
'Check for errors
If SQL_ErrorPending Then
SQL_MsgBox SQL_ErrorQuickAll, %MSGBOX_OK
End If
Best regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 Powerbasic,并且在尝试找到试用版时遇到了困难。不过,我一直在思考这个问题。您注意到更新和删除以及此插入语句都会出现问题。这让我相信,也许正在设置一个属性来指示该语句应该返回游标,而实际上它不返回游标。然而,这更多的是一个疯狂的猜测。
ODBC 跟踪是否可以揭示已更改的选项?
I am not familiar with Powerbasic and have had trouble attempting to find a trial version. However, I have been thinking about this. You noted that the issue occurs with update and delete as well as this insert statement. This leads me to believe that perhaps an attribute is being set to indicate the statement should return a cursor when it does not. However this is more of a wild guess.
Does an ODBC trace shed any light as to the options that were changed?