TADOStoredProc Problem - Insert Proc duplicating data???

From: greg (gregstroud2002_at_yahoo.com)
Date: 03/30/05


Date: 29 Mar 2005 21:42:33 -0800


I'm using a ADOStroedProc to Append a table (is Access 2003). The problem I'm getting is the ADOStoredProc is properly getting it's parameters assigned with values but for some reason it's duplications some rows (as it loops through the while not eof clause). I've stepped through the debugger an witnessed it (the parameter)getting assigned the proper values but on the ExecProc it posting the previously assigned values again???

Here is the code. Very straigth forward. Is this a bug or am I messing something here?

Thanks in advance

Greg

qryQueried.First;
      while not qryQueried.Eof do begin

         sp.Parameters.ParamByName('aChkNum').Value:= Trim(qryQueried.fieldbyName('CheckNumber').AsString);
         sp.Parameters.ParamByName('aRoute').Value:= Trim(qryQueried.fieldbyName('route').AsString);
         sp.Parameters.ParamByName('aCardNum').Value:= Trim(qryQueried.fieldbyName('idcardnum').AsString);
         sp.Parameters.ParamByName('aStoreName').Value:= Trim(qryQueried.fieldbyName('storename').AsString);
         sp.Parameters.ParamByName('adebtor').Value:= Trim(qryQueried.fieldbyName('debtor').AsString);
         sp.Parameters.ParamByName('aAddr1').Value:= Trim(qryQueried.fieldbyName('haddress1').AsString);
         sp.Parameters.ParamByName('aAddr2').Value:= Trim(qryQueried.fieldbyName('haddress2').AsString);
         sp.Parameters.ParamByName('aCity').Value:= Trim(qryQueried.fieldbyName('hcity').AsString);
         sp.Parameters.ParamByName('aState').Value:= Trim(qryQueried.fieldbyName('hstate').AsString);
         sp.Parameters.ParamByName('aZip').Value:= Trim(qryQueried.fieldbyName('hzipcode').AsString);
         sp.Parameters.ParamByName('aSSN').Value:= Trim(qryQueried.fieldbyName('ssn').AsString);
         sp.Parameters.ParamByName('aCkDate').Value:= qryQueried.fieldbyName('checkdate').AsDateTime;
         sp.Parameters.ParamByName('aRtnCode').Value:= Trim(qryQueried.fieldbyName('returncode').AsString);
         sp.Parameters.ParamByName('aAmt').Value:= qryQueried.fieldbyName('amount').AsCurrency;
         sp.Parameters.ParamByName('aTrnDt').Value:= qryQueried.fieldbyName('TurnoverDate').AsDateTime;
         sp.Parameters.ParamByName('aBankName').Value:= Trim(qryQueried.fieldbyName('BankName').AsString);
         sp.Parameters.ParamByName('aIDKey').Value:= Trim(qryQueried.fieldbyName('idkey').AsString);
         //getPhoneNumber(Trim(qryQueried.fieldbyName('idkey').AsString));
         sp.ExecProc;
         qryQueried.Next;

      end;



Relevant Pages

  • Re: .net 2.0 framework compatability
    ... I would agree also it was probably a bug. ... "I just ran my test app from that thread on a machine with ... You would think .NET apps would REQUIRE the framework they were complied ... Greg ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Linux v2.6.18-rc5
    ... funeral in Finland, but Greg and Andrew kept on top of things, and we were ... issues in 2.6.18-rc* (and earlier kernels, ... I'm doing all I can to gather info for Nathan so he can fix the bug, ...
    (Linux-Kernel)
  • Re: kobject_register failed for Promise_Old_IDE (-17)
    ... >> Greg, IIRC, weren't there plans to turn this case into a BUG()? ... > No, we dump the stack trace so that people can see what is happening, ...
    (Linux-Kernel)
  • Re: kobject_register failed for Promise_Old_IDE (-17)
    ... >>> Greg, IIRC, weren't there plans to turn this case into a BUG()? ... >> No, we dump the stack trace so that people can see what is happening, ...
    (Linux-Kernel)
  • Re: Status of Bug 8094 - ipaq oops on connecting "Vodafone VPA-II" ?
    ... But that bug is marked as "CLOSED CODE_FIX", though reading through ... the fix from that bug report _was_ merged as commit ... 9aebfd6bda789891e6d296bb49b5fb32d1057f18 (written by Greg). ...
    (Linux-Kernel)