Question

Quelqu'un peut-il m'aider et expliquer à mon pourquoi ce code se bloque sur l'instruction EXECSQL?

function UpdateLastBankResponsesId(ADatabase: TDatabase; AValue: Integer): String;  
var  
AQuery2: TQuery;  
begin 
result:= ''; 
AQuery2:= TQuery.Create(nil); 
AQuery2.DatabaseName:= ADatabase.DatabaseName;  
with AQuery2 do  
begin  
SQL.Text:= 'UPDATE last_id Set TABLENAME =:ATableName, LASTID=:ALastId';  
ParamByName('ATableName').AsString:= 'responses';  
ParamByName('ALastId').AsInteger:= AValue;  
try  
ExecSql; //***** CRASHES HERE *****  
except  
begin  
ExitCode:= 16;  
raise ECustomException.create('Error Updating Last Id table!');  
end;//except  
end; //try  
end; //with  
AQuery2.Free;  
end;  

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top