L
lkpc
Unregistered / Unconfirmed
GUEST, unregistred user!
环境::access97数据库,BDE,delphi5
下面是我的代码:
Close;
sql.clear;
sql.Add('select b2,b3,b5,b6,b8,a2,a3,a6 from bb,aa ');
sql.Add('where b2 not in (select b2,d2 from bb,dd where ');
sql.Add('b2=d2 and d6 BETWEEN 3 and 4 and d4=5)');
sql.Add(' and b6 BETWEEN 1 and 2 and b1=a1 ');
ParamByname('p1').value:=DateTimePicker1.DateTime;
ParamByname('p2').value:=DateTimePicker2.DateTime;
ParamByname('p3').value:=DateTimePicker3.DateTime;
ParamByname('p4').value:=DateTimePicker4.DateTime;
ParamByname('p5').value:=query20.FieldValues['d4'];
prepare;
open;
在运行时提示错误:字段p5未知!P5明明是参数,怎么把它当作了字段?
下面是我的代码:
Close;
sql.clear;
sql.Add('select b2,b3,b5,b6,b8,a2,a3,a6 from bb,aa ');
sql.Add('where b2 not in (select b2,d2 from bb,dd where ');
sql.Add('b2=d2 and d6 BETWEEN 3 and 4 and d4=5)');
sql.Add(' and b6 BETWEEN 1 and 2 and b1=a1 ');
ParamByname('p1').value:=DateTimePicker1.DateTime;
ParamByname('p2').value:=DateTimePicker2.DateTime;
ParamByname('p3').value:=DateTimePicker3.DateTime;
ParamByname('p4').value:=DateTimePicker4.DateTime;
ParamByname('p5').value:=query20.FieldValues['d4'];
prepare;
open;
在运行时提示错误:字段p5未知!P5明明是参数,怎么把它当作了字段?