起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 135|回复: 4

【搞定】[]代码报错,请帮忙**

[复制链接]
发表于 2007-4-20 09:22:42 | 显示全部楼层 |阅读模式
try
   lvForm:=TSRMM.Create(context);
   if lvForm.ShowModal=Business.Forms.Controls.mrOk then
   begin
     DataSetquery1.First;
     DataSetquery2.Close;   
     DataSetquery2.Open;
     while not DataSetquery1.Eof do
      begin
        with DatasetQuery2 do
        begin
           insert;
           FieldByName('CREATENAME').AsString:=DataSetquery1.FieldByName('CREATENAME').AsString;
           FieldByName('CREATEDATE').AsString:=DataSetquery1.FieldByName('CREATEDATE').AsString;
           FieldByName('UPDATENAME').AsString:=DataSetquery1.FieldByName('UPDATENAME').AsString;
           FieldByName('UPDATEDATE').AsString:=DataSetquery1.FieldByName('UPDATEDATE').AsString;
           FieldByName('SERIES').AsString:=DataSetquery1.FieldByName('SERIES').AsString;
           FieldByName('DELNO').AsString:=DataSetquery1.FieldByName('DELNO').AsString;
           FieldByName('DELTYPE').AsString:=DataSetquery1.FieldByName('DELTYPE').AsString;
           FieldByName('ORDERDATE').AsString:=DataSetquery1.FieldByName('ORDERDATE').AsString;
           FieldByName('REVISE').AsString:=DataSetquery1.FieldByName('REVISE').AsString;
           FieldByName('CUSTNO').AsString:=DataSetquery1.FieldByName('CUSTNO').AsString;
           FieldByName('CONTNO').AsString:=DataSetquery1.FieldByName('CONTNO').AsString;
           FieldByName('TOWHO').AsString:=DataSetquery1.FieldByName('TOWHO').AsString;
           FieldByName('TOWHOADDR').AsString:=DataSetquery1.FieldByName('TOWHOADDR').AsString;
           FieldByName('DELDATE').AsString:=DataSetquery1.FieldByName('DELDATE').AsString;
           FieldByName('SEQNO').AsString:=DataSetquery1.FieldByName('SEQNO').AsString;
           FieldByName('STUFFNO').AsString:=DataSetquery1.FieldByName('STUFFNO').AsString;
           FieldByName('PRODNO').AsString:=DataSetquery1.FieldByName('PRODNO').AsString;
           FieldByName('WIDTHKIND').AsString:=DataSetquery1.FieldByName('WIDTHKIND').AsString;
           FieldByName('UPWIDTH').AsString:=DataSetquery1.FieldByName('UPWIDTH').AsString;
           FieldByName('UPWEIGHT').AsString:=DataSetquery1.FieldByName('UPWEIGHT').AsString;
           FieldByName('COLOR').AsString:=DataSetquery1.FieldByName('COLOR').AsString;
           FieldByName('COLORCARD').AsString:=DataSetquery1.FieldByName('COLORCARD').AsString;
           FieldByName('RIGHTSTATE').AsString:=DataSetquery1.FieldByName('RIGHTSTATE').AsString;
           FieldByName('ISDEBIT').AsString:=DataSetquery1.FieldByName('ISDEBIT').AsString;
           FieldByName('ISWORK').AsString:=DataSetquery1.FieldByName('ISWORK').AsString;
           FieldByName('ARSEQNO').AsString:=DataSetquery1.FieldByName('ARSEQNO').AsString;
           FieldByName('ARSEQEXT').AsString:=DataSetquery1.FieldByName('ARSEQEXT').AsString;
           FieldByName('TGETRATE').AsString:=DataSetquery1.FieldByName('TGETRATE').AsString;
           FieldByName('FINISHDATE').AsString:=DataSetquery1.FieldByName('FINISHDATE').AsString;
           FieldByName('TRACKNO').AsString:=DataSetquery1.FieldByName('TRACKNO').AsString;
           FieldByName('REMARK').AsString:=DataSetquery1.FieldByName('REMARK').AsString;
           FieldByName('GETGOODS').AsString:=DataSetquery1.FieldByName('GETGOODS').AsString;
           FieldByName('DELTOWHO').AsString:=DataSetquery1.FieldByName('DELTOWHO').AsString;
           FieldByName('DELPN').AsString:=DataSetquery1.FieldByName('DELPN').AsString;
           FieldByName('DELQTY').AsString:=DataSetquery1.FieldByName('DELQTY').AsString;
           FieldByName('DELQTYYARD').AsString:=DataSetquery1.FieldByName('DELQTYYARD').AsString;
           FieldByName('FROMWHO').AsString:=DataSetquery1.FieldByName('FROMWHO').AsString;
           FieldByName('OLDSEQ').AsString:=DataSetquery1.FieldByName('OLDSEQ').AsString;
           FieldByName('DYESEQ').AsString:=DataSetquery1.FieldByName('DYESEQ').AsString;
           FieldByName('DELKIND').AsString:=DataSetquery1.FieldByName('DELKIND').AsString;
           FieldByName('FLOWFLAG').AsString:=DataSetquery1.FieldByName('FLOWFLAG').AsString;
           FieldByName('DELMETER').AsString:=DataSetquery1.FieldByName('DELMETER').AsString;
           FieldByName('DELLB').AsString:=DataSetquery1.FieldByName('DELLB').AsString;
           FieldByName('ORDERNO').AsString:=DataSetquery1.FieldByName('ORDERNO').AsString;
           FieldByName('ACCTYPE').AsString:=DataSetquery1.FieldByName('ACCTYPE').AsString;         
        end;
        DataSetquery1.Next;
      end;

  
     try
       DataSetquery2.ApplyUpdates(-1);
       v_status:='Ledwayknit.delivery备份到server243成功,';
     except
       v_status:='Ledwayknit.delivery备份server243失败,';
       dialogs.ShowMessage(v_status);
       exit;
     end;


报错
invoke batch method error, error occur during invoke ApplyUpdates method, Parameter #32as not been set.

DataSetquery2的更新语句是  

insert into ledwayknit.delivery(createname,createdate,updatename,updatedate,series,delno,deltype,orderdate,revise,custno,contno,towho,towhoabbr,deldate,seqno,stuffno,prodno,widthkind,upwidth,dnwidth,upweight,dnweight,color,colorcard,rightstate,isdebit,iswork,arseqno,arseqext,tgetrate,finishdate,trackno,remark,getgoods,deltowho,delpn,delqty,delqtyyard,fromwho,oleseq,dyeseq,delkind,flowflag,delmeter,dellb,orderno,acctype)
values(:createname,:createdate,:updatename,:updatedate,:series,:delno,:deltype,rderdate,:revise,:custno,:contno,:towho,:towhoabbr,:deldate,:seqno,:stuffno,:prodno,:widthkind,:upwidth,:dnwidth,:upweight,:dnweight,:color,:colorcard,:rightstate,:isdebit,:iswork,:arseqno,:arseqext,:tgetrate,:finishdate,:trackno,:remark,:getgoods,:deltowho,:delpn,:delqty,:delqtyyard,:fromwho,leseq,:dyeseq,:delkind,:flowflag,:delmeter,:dellb,rderno,:acctype)
回复

使用道具 举报

 楼主| 发表于 2007-4-20 09:23:22 | 显示全部楼层
报错
invoke batch method error, error occur during invoke ApplyUpdates method, Parameter #64 as not been set.
回复 支持 反对

使用道具 举报

发表于 2007-4-20 10:46:15 | 显示全部楼层
请提供DatasetQuery2 的每一个字段的字段名
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-4-21 09:10:04 | 显示全部楼层
算了 自己解决了   真是奇怪  我非要把insert语句的这个towhoabbr给去掉才行,但是数据库有这个字段啊
回复 支持 反对

使用道具 举报

发表于 2007-4-21 16:17:39 | 显示全部楼层
DataSetquery2的select 语句中有towhoabbr字段吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-1-4 19:50 , Processed in 0.038987 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表