用ADOQuery来实现例: with ADOQuery do begin close; SQL.Clear; SQL.add('select * from TableName'); try open; except execSQL; end; if RecordCount>0 then begin while not EOF do begin //逐行读取数据,以下面做你想要做的操作 Edit1.text := fieldByName('客户编号').value; ... next; end; end; end;
你的视图不是这个意思吧,好像是BI的某个简易功能?就是一个stringgrid,双击一个单元就执行一个查询(条件是该单元的内容)
with ADOQuery do
begin
close;
SQL.Clear;
SQL.add('select * from TableName');
try
open;
except
execSQL;
end;
if RecordCount>0 then
begin
while not EOF do
begin
//逐行读取数据,以下面做你想要做的操作
Edit1.text := fieldByName('客户编号').value;
...
next;
end;
end;
end;