How to pass parameters to a query in the DataEnvironment?
Hi,
How do I pass parameters to a query (Command Object) of a DataEnvironment? I am not being able to assign it in the Command Designer...
Specifically I want my query to be something like
SELECT fieldname1 FROM table1
WHERE
field2 = x;
where the value of x should be changeable at runtime.
And how do I build this query using the SQL builder applet?
The database I'm using is Oracle 8.
Thanks for your time.
Re: How to pass parameters to a query in the DataEnvironment?
to build up your sql string you should do something like
sqlstring = "Select fieldname1 From table1 WHERE field2 = '" & x & "'"
you have to use the ' signs if field2 is a text file
Re: How to pass parameters to a query in the DataEnvironment?
in the command designer write your sQL command like this:
select * from lahadr where name = ?
if necessary modify the attributes of that parameter in the parameters tab of the command dialog.
to pass that param in your vb code
de.Command1 "meier"
MsgBox de.rsCommand1.Fields(0)
de.rsCommand1.Close