Advantage TDataSet Descendant
Retrieves the result of the last Advantage Client Engine function call.
function AdsGetLastError( var strError : String ) : Longint;
|
strError |
Returns the error string corresponding to return value. It will be similar to the string return by AdsGetErrorString but may have information specific to the error instance such as table names. |
The error code returned by this function will be the same as the one returned by the last Advantage Client Engine function call. The first action of each Advantage Client Engine function is to clear the previous error if there is one. Thus, a call to AdsGetLastError is valid only for the most recent function call as opposed to the most recently occurring error. If no error occurred on the last Advantage Client Engine function call, a 0 (zero) is returned.
procedure TForm1.ShowLastAdvantageError( oTable : TAdsTable );
var
strError : string;
lErrorCode : longint;
begin
lErrorCode := oTable.AdsGetLastError( strError );
if ( lErrorCode <> 0 ) then
Application.MessageBox( pchar(strError), 'Advantage Error', 0 );
end;