关键不能打开,如果我用paradox7数据库时dbgrid中选择多项记录并删除时报错,定义了关键
字后就没是,可定义关键字后对增加又带来了不变,因为它是排序的,所以增加时它不是增加
到末尾。下面是没有定义关键字报的错:
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
只能删除一条记录
query12,query13共同指向一个表,query12与dbgrid相连并排序查找。
请问我因怎么解决?