AdoQuery的ExecSQL方法有个返回值表示执行数据的数量Delphi syntax:function ExecSQL: Integer;C++ syntax:int __fastcall ExecSQL(void);DescriptionCall ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).ExecSQL returns an integer value reflecting the number of rows affected by the executed SQL statement.Note: For SELECT statements, call Open instead of ExecSQL or set the Active property to true.To speed performance, an application should ordinarily prepare the query by setting the Prepared property to true before calling ExecSQL for the first time.
try ... Except on E: Exception do begin showmessage(E.Message); end; End;
2.如果你说的这个执行成功是需要体现在有没有影响记录的话,最好在执行完后,取@@ROWCOUNT,全局变量值,(SET ROWCOUNT ON) ,看看到底有没有执行成功就可以了,其他办法我就不知道了
...
Except
on E: Exception do begin
showmessage(E.Message);
end;
End;