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.
Cannot use Update and Insert statement with Access2000 in PB
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;
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;