Subject RE: [IBO] Problems with EOF
Author carl.mcknight@dot.gov
Try this:

qryFollowUpEmails.Next

The "Next" is outside the With statement.

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On
Behalf Of petesouthwest
Sent: Monday, November 07, 2005 4:33 PM
To: IBObjects@yahoogroups.com
Subject: [IBO] Problems with EOF


Hi

I have a procedure below, that I thought should loop through a group of
records and update a couple of fields. However, it will do the first
record only, never seeming to execute the 'next'. I'm obvioulsy
mis-understood the function of something, but cant work out what! If
someone could point out the error in my understanding I would be very
gratefull! :)

Thanks for any help given.

Pete





procedure tform1.closeCorrespondence;
begin
qryFollowUpEmails.FetchAll;
qryFollowUpEmails.first;
qryFollowUpEmails.requestlive:=true;
qryFollowUpEmails.open;
qryFollowUpEmails. edit;
while not qryFollowUpEmails.Eof do
begin
with qryFollowUpEmails do
begin
fieldbyname('correspondencedate').value:=now();
Fieldbyname('status').AsString:='closed';
end;
next;
end;
qryFollowUpEmails.post;
end;






________________________________________________________________________
___
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
________________________________________________________________________
___
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !

Yahoo! Groups Links