中国四大石窟的特点:请教一下关于delphi的问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 01:54:33
procedure find1(sender:tobject;qstr:string);
var i:integer;
begin
with form1.adoquery1 do
begin
close;
sql.Clear ;
sql.add('select * from 企业数据库 '+qstr);
open;
for i:=0 to fieldcount-1 do
begin
(sender as tstringgrid).Cells[i,0]:=fields[i].FieldName ;//加载字段名称给STRINGGRID
end;
if recordcount>0 then
begin
first;
while not eof do
begin
for i:=0 to fieldcount-1 do
begin
(sender as tstringgrid).Cells[i,1]:=fields[i].AsString;
end;
next;
end;
end
else
showmessage('没有查找到符合条件的记录!');
end;
end;

我的模糊查询只能显示第一条记录,其他相关内容都无法显示,据说是这段代码里面的FOR语句有问题,可是问题在哪里呢?我真的百思不得其解,各位高手们~请帮帮忙吧

qstr是如何传递的?模糊查询需要用like '%'+qstr+'%'的