为什么显示找不到字段信息?(100分)

网虾

Unregistered / Unconfirmed
GUEST, unregistred user!
我按照一书例将一tquery的sql设为如下
select UserID,UserName,TrueName
from user
where not exists(
select GroupID
from Members
where (members.UserID=users.UserID) and (members.GroupID=:GroupID))
group by UserName,TrueName,UserID
tquery的databasename为dsGroup,dsGroup的dataset为tbGroup,tbGroup对应的group中包含有GroupID字段(为autoincrement类型),但members中的GroupID字段(为shortint类型)。tquery的active可设为true,在dsGroup的active设为true时;与tquery连接的dbgrid显示UserName,TrueName,UserID三列。
但每次重新打开程序显示tbGroup:field'GroupID' not found的提示信息,tquery的active变为false,请问各位大侠是何原因,该如何解决?
 
where (members.UserID=users.UserID) and (members.GroupID=:GroupID))
中的=:GroupID中GroupID的这是个参数,等于什么?
 
应该在执行之前先给:groupid变量赋值.
如:query1.params[0].asstring:=edit1.text;
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
351
import
I
S
回复
0
查看
819
SUNSTONE的Delphi笔记
S
顶部