注册 登录
编程论坛 Delphi论坛

为什么没有结果呢

leixiangchao 发布于 2007-08-10 15:55, 638 次点击
var
k:integer;
begin
if combobox1.Text='所有' then
ownersqlstr:=''
else
begin
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select * from t_owner
where ownername=''combobox1.text''');
ADOQuery2.Open;
k:=ADOQuery2.FieldValues['owner'];
ownersqlstr:=' and A.trackid in
(select trackid
from v_equipstate
where owner=''k'')';
end;
2 回复
#2
nongen2007-08-10 16:41
ADOQuery2.SQL.Add('select * from t_owner
where ownername=''combobox1.text''');
这句错了。
ADOQuery2.SQL.Add('select * from t_owner
where ownername='''+combobox1.text+'''');
#3
leixiangchao2007-08-13 15:51

谢谢
因为问题有人解决了,几天没有来了
不过依然谢谢你

1