found it. A common tdatabase component between the query and the table
-----Original Message-----
From: Maurice Butler <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Monday, 30 November 1998 15:05
Subject: [DUG]: Simple Query Problem

I am trying to process all the records returned by a query from a server. It works for the first record alright then when I go to get the next record from the query it refetches the data and moves to the second record. - If I use Evaluate/Modify dialog box I can move down records with out them being refetched.
Is there a way I can move to the third and subsequent records programmably ?
 
    qryOneWorld.SQL.LoadFromFile('Get selected records from Server.SQL');
    qryOneWorld.Open;
    qryOneWorld.FetchAll;
    qryOneWorld.First;
    try
      while not qryOneWorld.EOF do
        begin
          vItem[0] := qryOneWorld.FieldByName('UDBAR').AsString;
          vItem[1] := qryOneWorld.FieldByName('UDPLUT').AsString;
          vItem[2] := qryOneWorld.FieldByName('UDCART').AsString;
 
          if ttJLItem.Locate( 'BARCODE;UNIT;CTN_NUMBER', vItem, [])then
            begin
              ttJLItem.Edit;
              ttJLItem.FieldByName('ACK_MESS').AsString :=  qryOneWorld.FieldByName('UDACKM').AsString;
              ttJLItem.FieldByName('ACK').AsString := formatDateTime('hh:nn:mm dd mmm yyyy',now);
              ttJLItem.Post;
            end;
          qryOneWorld.Next;         <- this is the line that is causing me problems.
                                           I keep ending up at the second record of the result set
        end;
    finally
      qryOneWorld.Close;
    end;
--------------------------------------------------------------------------------
Maurice Butler     Like Magic Ltd    (025) 273 9248

Reply via email to