T
taiyuntao
Unregistered / Unconfirmed
GUEST, unregistred user!
输入条件为人的姓名(name),查询出卡号,刷卡时间,刷卡的门,为什么输入姓名后查询就提示列名'xxx(输入的姓名)'无效,求富翁给看看,一定高分相送
sqlstr:='where PubUserInfo.username='+name;
strq:=' and PubUseCardManage.cardid=PubvalidCardEvent.cardid';
strw:=' and PubvalidCardEvent.PointAddress=LwsNetDoor.DoorAddress';
strx:=' and PubvalidCardEvent.ControlMachineAddress=LwsNetDoor.ControlMachineAddress';
stry:=' and PubUseCardManage.userid=PubUserInfo.userid ';
s1:='select username,PubvalidCardEvent.cardid,PubvalidCardEvent.eventtime,LwsNetDoor.doorname';
s2:='from PubUseCardManage,PubUserInfo,PubvalidCardEvent,LwsNetDoor';
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add(s1);
sql.Add(s2);
sql.add(sqlstr);
sql.Add(strq);
sql.Add(strw);
sql.Add(strx);
sql.Add(stry);
sql.Add('order by eventtime desc');
prepared;
open;
end;
sqlstr:='where PubUserInfo.username='+name;
strq:=' and PubUseCardManage.cardid=PubvalidCardEvent.cardid';
strw:=' and PubvalidCardEvent.PointAddress=LwsNetDoor.DoorAddress';
strx:=' and PubvalidCardEvent.ControlMachineAddress=LwsNetDoor.ControlMachineAddress';
stry:=' and PubUseCardManage.userid=PubUserInfo.userid ';
s1:='select username,PubvalidCardEvent.cardid,PubvalidCardEvent.eventtime,LwsNetDoor.doorname';
s2:='from PubUseCardManage,PubUserInfo,PubvalidCardEvent,LwsNetDoor';
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add(s1);
sql.Add(s2);
sql.add(sqlstr);
sql.Add(strq);
sql.Add(strw);
sql.Add(strx);
sql.Add(stry);
sql.Add('order by eventtime desc');
prepared;
open;
end;