with qrytemp do
begin
if active then close;
sql.clear;
sql.test := 'select * from tablename where stuname='+QuotedStr('nciwp');
open;
end;
或者
with qrytemp do
begin
if active then close;
sql.clear;
sql.test := 'select * from tablename ';
sql.add('where stuname='+QuotedStr('nciwp'));
open;
end;