Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00515140
Message ID:
00515762
Views:
11
Hi!

The '?' in SQLEXEC evaluates the variable or table field reference after it. If the variable or field does not exists, you will get error. So when you have query like:

"SELECT * FROM aaa where a1=?aaa1 and a2=?aaa2 ..."
You will require to prepare these variables before the SQLEXEC command, not before the command like 'lcSQL="SELECT ..."'. Variables should exist when you execute the query, not preparing a query string. If you want to pass parameters when preparing a query string, you require another approach, as already described. And sometimes it is not completely reliable for character values.

If you did not already figurd out the problem by self, post a code here with error.



>Vlad:
> I did try your method, it did not work the first time. It prompt me for a value. I just tried it again, it works. I must typed something wrong on the first try. Thanks.
> On another sqlexec command I am getting this error: connectivity error [MICROSOFT][ODBC MICROSOFT ACCESS DRIVER]too few parameters. Expected 9. Could you help?
>sherry
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform