选项值已更改 - ODBC 错误 2169

发布于 2024-08-27 10:34:31 字数 1281 浏览 10 评论 0原文

感谢您的回复。

我使用 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 技术交流群。

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

发布评论

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

评论(1

身边 2024-09-03 10:34:31

我不熟悉 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?

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