TMyScript and LAST_INSERT_ID

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

TMyScript and LAST_INSERT_ID

Post by ben » Wed 21 Dec 2005 14:48

I Have a TMyScript that adds some records and I want to know the last auto ID inserted.

I tried to execute a TMyQuery with SELECT LAST_INSERT_ID() but it returns 0.

any idea?

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

Post by Ikar » Fri 23 Dec 2005 10:48

Try to connect MyQuery to MyScript and use MyQuery.AfterExecute event to get MyQuery.InsertId property value

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

Post by ben » Sun 25 Dec 2005 09:33

any example how to connect myquery with tmyscript?

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

Post by Ikar » Mon 26 Dec 2005 10:52

Just place MyScript and MyQuery components to form and set MyScript.DataSet to MyQuery.

Post Reply