主表:用了一个adoquery,sql为:select * from doctor;在表doctor里有一个doc_state字段,现在我想当doc_state为2时,从表就不显示数据,当不为‘2'时,从表就显示select * from patient.
如何实现??
我本来想写select * from patient where :doc_state<>'2' 但通不过
如何实现??
我本来想写select * from patient where :doc_state<>'2' 但通不过
解决方案 »
- 问问大家关于delphi7.0的版权问题
- 如何公开保护的方法
- 怎样通过delphi进行数据库相近搜索
- 大龙驹老师接分,感谢您为俺们这帮菜鸟热情的解答
- 打开的窗体的文本标识全是乱码
- 为什么说key=#13内型不匹配?
- ●●●请推荐好点的收费空间●●●
- 廉价的小问题:看看不妨!
- 谁有VCL核心类的关系图?-----------------------------------------------------
- 安装程序?
- 请教高手一个问题,在执行一个窗体文件时,出现如下错误信息,undeclared identifier:'customersearchform',应该怎么办,谢谢!
- 用Qreport怎样选择自定义的纸张
'2'是字符串
did u use TDataSource (suppose dsDoctor)associated to the tbDoctor
and set tbPatient.MasterSource:=dsDoctor??
where not :doc_state='2'
Filter来过滤数据
Filtered := false;
filter := ' doc_state = ' + QuotedStr('2');
Filtered := true;
:doc_state<>'2'是不是不能这样写,当这个从表的adoquery open时,提示错误parameter对象被不正确定义,提供了不一致或不完整的信息
第二請注意看看ObjectInspector關於Parameter的ParamType