救救我,一个sql语句查询问题,我查不出原因!
下面这段程序我无论在edit3文本框里面输入什么,它都会执行 showmessage('退料单所对应的领料单号不存在!');
但是我把sql.Text的内容放入sql查询分析器里面执行,明明是有一条记录的。
我不用参数,直接
sql.Add('select * from outbill where outbhid=''R000001'' and type=''0''');
后面还是执行了showmessage('退料单所对应的领料单号不存在!'); 但我发誓R000001这个领料单号绝对存在!
因为在查询分析器中可以查询到(select * from outbill where outbhid='R000001' and type='0')
with datamodule1.Query2 do
begin
close;
sql.Clear;
sql.Add('select * from outbill where outbhid=:outbhid and type=''0''');
Parambyname('outbhid').AsString:=trim(edit3.Text);
// showmessage(edit3.Text);
//showmessage(sql.Text); //直接运行这条语句
if eof=true then
begin
showmessage('退料单所对应的领料单号不存在!'); //不管存不存在都提示不存在
exit;
end;
end;
我用的是paradox数据库,应用程序中其它查询都没问题,就这个有,请问是为什么???