Page 1 of 1

ParamByName in TMyScript

Posted: Sat 27 May 2006 07:11
by ben
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

Posted: Mon 29 May 2006 12:47
by Antaeus
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.

Posted: Mon 29 May 2006 14:49
by ben
I use mysql 5.
Ok about OpenNext.

what if I want to use multiple non-result queries?
For example 3 INSERTS that dont return a result.

Thanks

Posted: Tue 30 May 2006 11:28
by Ikar
Now MyDAC doesn't provide such functionality. We are thinking about adding it in next MyDAC version.