Page 1 of 1

TMyScript and LAST_INSERT_ID

Posted: Wed 21 Dec 2005 14:48
by ben
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?

Posted: Fri 23 Dec 2005 10:48
by Ikar
Try to connect MyQuery to MyScript and use MyQuery.AfterExecute event to get MyQuery.InsertId property value

Posted: Sun 25 Dec 2005 09:33
by ben
any example how to connect myquery with tmyscript?

Posted: Mon 26 Dec 2005 10:52
by Ikar
Just place MyScript and MyQuery components to form and set MyScript.DataSet to MyQuery.