function TmyADOFunctions.ADOInsertIntoDB(a_SQLStatement:
string): TMyADOResultStruct;
var
myADOResultStruct : TMyADOResultStruct;
lCounter : integer;
begin
assert(true = Prod_Conn_CorrectConnected);
myADOResultStruct := TMyADOResultStruct.Create;
// init
try
ADOCommand1.Connection.BeginTrans;
ADOCommand1.CommandType := cmdText;
ADOCommand1.CommandText := a_SQLStatement;
ADOCommand1.Connection.Execute(a_SQLStatement, lCounter);
myADOResultStruct.counter := lCounter;
ADOCommand1.Connection.CommitTrans;
myADOResultStruct.status := true;
except
// wenn Fehler abbrechen...
on E:
Exception do begin
ADOCommand1.Connection.RollbackTrans;
myADOResultStruct.status := false;
myADOResultStruct.exception := E;
myADOResultStruct.exceptionTxt := E.
Message;
end;
end;
// try-except
Result := myADOResultStruct;
end;