with adoquery1 do try close; sql.clear; sql.add('select * from tablename'); prepared; open; if not isempty then begin first; while not eof do begin memo1.lines.add(fields[0].asstring); next; end; end; except showmessage('false'); exit; end;
with ADOQuery1 do begin Close; SQL.Clear; SQL.Add('select 某一字段 from 表名'); Open; First; if ADOQuery1.RecordCount>0 then while not Eof then begin Memo1.Lines.ADD(FieldByName('某一字段').asstring); Next; end; end;
try
close;
sql.clear;
sql.add('select * from tablename');
prepared;
open;
if not isempty then
begin
first;
while not eof do
begin
memo1.lines.add(fields[0].asstring);
next;
end;
end;
except
showmessage('false');
exit;
end;
begin
Close;
SQL.Clear;
SQL.Add('select 某一字段 from 表名');
Open;
First;
if ADOQuery1.RecordCount>0 then
while not Eof then
begin
Memo1.Lines.ADD(FieldByName('某一字段').asstring);
Next;
end;
end;