There is a command: SELECT @@IDentity
Put this in the same AdoQuery component with the insert command. Call Open instead of ExecSql to retreive the data. It will return the Identity field for the record just added. i.e.
In the AdoQuery.Sql property enter
INSERT INTO TestTable (field1, Field2)
Values('Test1','Test2')
Select @@Identity as AutoIncFieldName
Then in the code call Open or Active := TRUE. This should give you the value of the identity.
Hope this helps