TMyScript and LAST_INSERT_ID

TMyScript and LAST_INSERT_ID

Postby 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?
ben
 
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Postby Ikar » Fri 23 Dec 2005 10:48

Try to connect MyQuery to MyScript and use MyQuery.AfterExecute event to get MyQuery.InsertId property value
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby ben » Sun 25 Dec 2005 09:33

any example how to connect myquery with tmyscript?
ben
 
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Postby Ikar » Mon 26 Dec 2005 10:52

Just place MyScript and MyQuery components to form and set MyScript.DataSet to MyQuery.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components