|
-
Mar 15th, 2000, 01:26 AM
#1
Thread Starter
New Member
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?
-
Mar 16th, 2000, 07:57 PM
#2
Addicted Member
I suggest using RecordSet objects instead of Command objects. Then you can change the query sentence without any problems.
-
Mar 16th, 2000, 09:54 PM
#3
You properly have to work with the command parameters.
Go to the command properties and set by the SQL statement
you SQL string like "SELECT * FROM [orders] WHERE [account]=?". let it end with "?" so the command would generate a parameter. when you have done this you have to define the parameter by the parameter tab. So i see you want to use a nummer. so you select the parameter as a integer. or a long integer. When your finish defining the parameter. you can place this line under a commandbutton or whatever.
Code:
DataEnvironment1.Command1 Int("12345")
You have to make for every SQL statement a new command.
-Kayoca Mortation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|