AnyDAC
Example
TADCustomConnection.GetLastAutoGenValue Method
ShowMessage(VarToStr(ADConnection1.GetLastAutoGenValue('MyGen')));