Hello,
I have a MyQuery and I successfully use parameters
MyQuery.ParamByName('something').AsDateTime := Now;
but it seems that I cant use that in TMyScript.
Why?
How can I setup multiple external fields in a TMyScript? What I want is to execute more than one queries at the time. Thats why I'm using TMyScript insteda of MyQuery.
Thanks
ParamByName in TMyScript
If you use MySQL Server 4.1 and higher, you can use TMyQuery component to execute multiple statements. Please pay attention on OpenNext method of TMyQuery.
If your MySQL Server is older than 4.1, you can try something like following:
- drop onto the form one extra MyQuery component
- assign to MyScript.DataSet property this MyQuery
- put some code to MyQuery.BeforeOpen to fill parameter values
One more way is usage of Macros.
If your MySQL Server is older than 4.1, you can try something like following:
- drop onto the form one extra MyQuery component
- assign to MyScript.DataSet property this MyQuery
- put some code to MyQuery.BeforeOpen to fill parameter values
One more way is usage of Macros.