PDA

Click to See Complete Forum and Search --> : Syntax Error passing SQL to DataEnvironment


MikeZ
Mar 15th, 2000, 12:29 AM
I am trying to pass a SQL to the DataEnvironment at run time
ysing the Command1_click event:

DataEnvironment1.Commands("orders").CommandText=_
SELECT account FROM orders WHERE account="12345";

And I get syntax error in FROM clause so I change tosee where the problem is to:
SELECT * FROM orders
And still get the same error what am I doing wrong?

Wesam
Mar 16th, 2000, 02:29 PM
Hi,

Unfortunately, I don't know what is DataEnvironment, but if you are going to pass a SQL string, then make sure of the following:

- The place where you use SQL commands accepts SQL commands.
- DataEnvironment1.Commands("orders").CommandText .. can
accept records found by SQL command. I feel that
CommandText is a property that accept only text (so one
record) and not many possible records.
- Check the quotation-marks everywhere. THIS VERY IMPORTANT.

regards,

Wesam.