D
dfwer
Unregistered / Unconfirmed
GUEST, unregistred user!
根据edit1、edit2等中的内容为条件从一个表a.dbf查询符合条件的记录并显示。
部分代码如下:
Query1.close;
query1.sql.clear;
if (edit1.text<>'') and (edit2.text='') and (edit3.text='') then
query1.sql.Add('select * from a where Wtgddm='+'''+edit1.text+''');
if (edit2.text<>'') and (edit1.text='') and (edit3.text='') then
query1.sql.Add('select * from a where Wtzqdm='+'''+edit2.text+''');
if (edit3.text<>'') and (edit1.text='') and (edit2.text='') then
query1.sql.Add('select * from a where Wthtxh like '''+edit3.text+'''');
query1.open;
edit1.clear;
edit2.clear;
edit3.Clear;
请问为什么DBGRID中为什么没有记录(能显示表的结构,就是说符合条件的记录数是0!!)?可是表a中是有的,哪位帮我看看什么地方有问题?
部分代码如下:
Query1.close;
query1.sql.clear;
if (edit1.text<>'') and (edit2.text='') and (edit3.text='') then
query1.sql.Add('select * from a where Wtgddm='+'''+edit1.text+''');
if (edit2.text<>'') and (edit1.text='') and (edit3.text='') then
query1.sql.Add('select * from a where Wtzqdm='+'''+edit2.text+''');
if (edit3.text<>'') and (edit1.text='') and (edit2.text='') then
query1.sql.Add('select * from a where Wthtxh like '''+edit3.text+'''');
query1.open;
edit1.clear;
edit2.clear;
edit3.Clear;
请问为什么DBGRID中为什么没有记录(能显示表的结构,就是说符合条件的记录数是0!!)?可是表a中是有的,哪位帮我看看什么地方有问题?