>** Form the query >sQuery = "SELECT IDENT_CURRENT('" + ALLTRIM(sTableName) + "')" > >** Run the query >iResult = SQLExec(.iConnHandle, sQuery, "last_id") > >** If the command completed successfully >IF iResult > -1 > > ** Store the results to the return value > iRetVal = last_id.exp > > ** Close the last_id table > USE IN last_id > >ELSE > > ** Call the routine to record the error info > ._GetErrorInfo() > >ENDIF >>