Another TQuery to TADOQuery migration problem
Angus Macdonald <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <8281693F9EF2B140AA145EE9BE4675A6042EBD51@nwwmail1.nww-tr.wales.nhs.uk> |
Thank you Tameem. I don't know how I managed to miss that combination.
Now, onto the next issue. The code below works fine:
query1.sql.clear;
query1.sql.add(sqlgetshareremaps); {share remapping function}
query1.open;
query1.first;
while not query1.eof do begin
shareremaps:=shareremaps+query1.fieldbyname('remapfrom').text+'^'+query1.fie
ldbyname('remapto').text+'#';
query1.next;
end;
query1.close;
While the code adapted for TADOQuery (below) fails on the final iteration of
ADOQuery1.Next ie after all 5 (in this case) table entries have been
retrieved
adoquery1.sql.clear;
adoquery1.sql.add(sqlgetshareremaps); {share remapping function}
adoquery1.open;
adoquery1.first;
while not adoquery1.eof do begin
shareremaps:=shareremaps+adoquery1.fieldvalues['remapfrom']+'^'+adoquery1.fi
eldvalues['remapto']+'#';
adoquery1.next;
end;
adoquery1.close;
The error in the NT Event log (the app is a service so there are no UI
messages) is
"Either BOF or EOF is true, or the current record has been deleted.
Requested operation requires a current record"
Can anyone shed some light on this one?
Regards
Angus
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get a FREE REFINANCE QUOTE - click here!
http://us.click.yahoo.com/nHYuCC/ca0FAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->
CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
---------------------------------------------------------------
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/