with qry_temp do
begin
close;
sql.clear;
sql.add(Format('select * from case_table where 代码=''%s''',[DBGD_many.Fields[1].asstring]));
Execsql;
end;
我用if Qry_temp.Fields[0].AsString<>'' then来判断是否有这个记录,却报错
List index out of bounds(0),不知该如何解决??求救!!
begin
close;
sql.clear;
sql.add(Format('select * from case_table where 代码=''%s''',[DBGD_many.Fields[1].asstring]));
Execsql;
end;
我用if Qry_temp.Fields[0].AsString<>'' then来判断是否有这个记录,却报错
List index out of bounds(0),不知该如何解决??求救!!
begin
close;
sql.clear;
sql.add(Format('select count(*) from case_table where 代码=''%s''',[DBGD_many.Fields[1].asstring]));
Execsql;
end;if Qry_temp.Fields[0].AsInteger=0 then
...
这里Execsql修改为OPEN,比较好。你可以用qry_temp.recordnum>0来判断