views:

51

answers:

1

Hello Edgar,

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,

A: 

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?

Edgar