ParamByName in TMyScript

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

ParamByName in TMyScript

Post by ben » Sat 27 May 2006 07:11

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

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 29 May 2006 12:47

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.

ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Post by ben » Mon 29 May 2006 14:49

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 30 May 2006 11:28

Now MyDAC doesn't provide such functionality. We are thinking about adding it in next MyDAC version.

Post Reply