Cannot use Update and Insert statement with Access2000 in PB

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
qui
Posts: 2
Joined: Thu Mar 20 2003
Contact:

Cannot use Update and Insert statement with Access2000 in PB

Post by qui » Thu Mar 20 2003

Hi there,

I have a problem when I program in Power Builder with database Access 2000. I usethe Update and Insert statements in the script as follows:

String ls_name
ls_name = "David"
Update employees Set name = ls_:name Where id = 1 Using SQLCA;

If SQLCA.SQLCode <> 0 Then
MessageBox("", String(SQLCA.SQLCode) + ' '+ SQLCA.SQLErrText);
End If

We always got the following error message:

-1 SQLSTATE = 07001
[Microsoft][ODBC Microsoft Driver] Too few parameters. Expected 1.

Similarly, I got the same problem with the Insert statement.
Although it works well with Oracle.

Any help would be appricated.

dclayton
Posts: 8
Joined: Mon Apr 14 2003
Location: Houston
Contact:

Post by dclayton » Wed Apr 16 2003

Your code is below:

String ls_name
ls_name = "David"
Update employees Set name = ls_:name Where id = 1 Using SQLCA;

If SQLCA.SQLCode <> 0 Then
MessageBox("", String(SQLCA.SQLCode) + ' '+ SQLCA.SQLErrText);
End If

It appears that you have the : in the wrong place. It should be something like:

Update employees Set name = :ls_name Where id = 1 Using SQLCA;

Post Reply