if not datamodule3.query12.Eof then
begin
if messagebox(0,'真的要删除此条记录吗?','警告',MB_ICONWARNING+MB_YESNO)=IDYES then
begin
if xsst_main.DBGrid6.SelectedRows.Count>1 then
begin
with xsst_main.DBGrid6.DataSource.DataSet do
for i:=0 to xsst_main.DBGrid6.SelectedRows.Count-1 do
begin
gotobookmark(pointer(xsst_main.DBGrid6.SelectedRows.items));
with datamodule3 do
begin
query13.Close;
query13.SQL.clear;
query13.sql.Add('delete from xs_usersd');
query13.SQl.Add(format(' where 巡视员编号='+'''%s''',[query12.fieldbyname('巡视员编号').asstring]));
query13.sql.add(format(' and 姓名='+'''%s''',[query12.fieldbyname('姓名').asstring]));
query13.sql.add(format(' and 出生年月='+'''%s''',[query12.fieldbyname('出生年月').asstring]));
query13.sql.add(format(' and 学历='+'''%s''',[query12.fieldbyname('学历').asstring]));
query13.sql.add(format(' and 工作单位='+'''%s''',[query12.fieldbyname('工作单位').asstring]));
query13.sql.add(format(' and 密码='+'''%s''',[query12.fieldbyname('密码').asstring]));
query13.Prepare;
query13.ExecSQL;
end;
end;
end;
end;
end;
没索引
选多个记录
提示query12 record not found
只能删除一条记录