K
kmif
Unregistered / Unconfirmed
GUEST, unregistred user!
sql 查询语句如何返回查询的结果到一个变量
如:
with adoquery1 do
begin
Close;
sql.Clear;
sq3:='select * from dbo.pass where usercode=:usercode and userpass=:userpass';
sql.add(sq3);
parameters.ParamByName('usercode').value:=code;
parameters.ParamByName('userpass').value:=pass;
open;
end;
name:=ADOQuery1.fieldbyname('username').AsString;
owner:=ADOQuery1.fieldbyname('userowner').AsString;
showmessage(name);
结果不能显示出来,请教!
如:
with adoquery1 do
begin
Close;
sql.Clear;
sq3:='select * from dbo.pass where usercode=:usercode and userpass=:userpass';
sql.add(sq3);
parameters.ParamByName('usercode').value:=code;
parameters.ParamByName('userpass').value:=pass;
open;
end;
name:=ADOQuery1.fieldbyname('username').AsString;
owner:=ADOQuery1.fieldbyname('userowner').AsString;
showmessage(name);
结果不能显示出来,请教!