Page 1 of 1

How can I get last autoincrement id after insert?

Posted: Mon 27 Mar 2006 09:28
by Alexmv
MyQuery1.SQL.Add('insert ...');
MyQuery1.Execute;

???

Posted: Mon 27 Mar 2006 09:55
by Antaeus
Try this:

Code: Select all

n := MyQuery1.InsertId;

Posted: Mon 27 Mar 2006 10:47
by Alexmv
work!
thank you