正
正牌初哥
Unregistered / Unconfirmed
GUEST, unregistred user!
我是个初学者。用的是SCOUNIX+ORACLE,客户机用bde代码是这样的:
sjy.query1.close;
sjy.query1.sql.Clear;
sjy.query1.sql.add('select cz,ch,cc,dzrq,xkrq,srsj,kxsj,xkrq,xkjbr,dzrq from chk ');
if sjy.query1.Prepared=false then sjy.query1.Prepare;
sjy.query1.close;
sjy.query1.Open;
label9.Caption:=formatdatetime('yy-mmm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);
sjy.query2.close;
sjy.query2.sql.Clear;
sjy.query2.sql.add('select ch,dzrq,xcp,hwjs,xcd from czchk where ch=:ch and dzrq=:dzrq');
sjy.Query2.ParamByName('ch').AsString:=sjy.Query1.fieldbyname('ch').AsString;
sjy.Query2.ParamByName('dzrq').AsString:=formatdatetime('yy-mmm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);
if sjy.query2.Prepared=false then sjy.query2.Prepare;
sjy.query2.close;
sjy.query2.Open;
出现错误ORA-01843 not a Valid month
label9.Caption是02-七月-15
改成formatdatetime('yy-mm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);也一样。
到底是什么问题,请各位指教一下小弟
sjy.query1.close;
sjy.query1.sql.Clear;
sjy.query1.sql.add('select cz,ch,cc,dzrq,xkrq,srsj,kxsj,xkrq,xkjbr,dzrq from chk ');
if sjy.query1.Prepared=false then sjy.query1.Prepare;
sjy.query1.close;
sjy.query1.Open;
label9.Caption:=formatdatetime('yy-mmm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);
sjy.query2.close;
sjy.query2.sql.Clear;
sjy.query2.sql.add('select ch,dzrq,xcp,hwjs,xcd from czchk where ch=:ch and dzrq=:dzrq');
sjy.Query2.ParamByName('ch').AsString:=sjy.Query1.fieldbyname('ch').AsString;
sjy.Query2.ParamByName('dzrq').AsString:=formatdatetime('yy-mmm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);
if sjy.query2.Prepared=false then sjy.query2.Prepare;
sjy.query2.close;
sjy.query2.Open;
出现错误ORA-01843 not a Valid month
label9.Caption是02-七月-15
改成formatdatetime('yy-mm-dd',sjy.query1.fieldbyname('dzrq').AsDateTime);也一样。
到底是什么问题,请各位指教一下小弟