比较简单点的一个完整程序是:
with adoquery1 do
begin
close;
sql.clear;
sql.text := 'select * from yourtable where fieldname = yourfield';
open;
if recordcount = 1 then
delete;
end;
up!!!
或者:
if messagebox(Application.handle,'要删除 么?', 'Conformation',MB_YesNo+MB_IconInformation)=IDYes then
with qury do begin
close;
sql.clear;
sql.add('delect from tableName where......')
try
execSql;
except
Messagebox(handle,'删除使出错!','Error',MB_Ok+Mb_IconError);
exit;
end;