Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TAdoQuery Not Updating All Records at runtime

Posted on 2003-10-21
6
Medium Priority
?
168 Views
Last Modified: 2010-08-05
I have a form with a TAdo Query.  When you click the button it scrolls through the table and then updates the record.. Or so it should.  e.g.  when running the first record only is updated.  If stepping through in debug/IDE then All records are correctly updated.

Using D7 connecting to Access Database.  HELP PLEASE..

   While not qryDataToCheck.Eof do
     Begin
       //Scroll Through the fields and do the checks on them

       while not cdCheckData.Eof do
         Begin
      {OMITTED bOk False if error found}
       qryDataToCheck.Edit;
       if  Not bOk then
           begin
             if bError then
                  qryDataToCheck.FieldByName('Data_Error_Found').Value := 'E'
             else qryDataToCheck.FieldByName('Data_Error_Found').Value := 'W';
            end
        else
           begin
           qryDataToCheck.FieldByName('Data_Error_Found').Value :=  Null ;
            end;
        qryDataToCheck.FieldByName('Data_Error_Comment').Value := sRecordError;

        qryDataToCheck.Post;
        qryDataToCheck.Next;
      end; //loop qryDataToCheck.eof
0
Comment
Question by:Icart
6 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9597634
It could be a timer-related issue. Maybe without the debugger running, the updates are too fast for Access to handle correctly. Then again, looking at your code extract, I noticed that the last end has a wrong comment. It is related to cdCheckData.Eof and not qryDataToCheck.Eof. So perhaps the problem is related to table-name confusion in your code.
0
 

Expert Comment

by:hetturki
ID: 9597871
first of all why you dont use UPDATE SQL like
Update TableName
set field1 = pla pla , .....
where <condition>

second
try to close the table at end of the procedure the makes the updates to your
table

Best Regards
0
 

Author Comment

by:Icart
ID: 9601414
Apologise for the cdCheckData and The qryDataToCheck loopy bit.  I am actually opening because I omitted code i didn't clip the correct do while..  The code runs perfectly as I say in IDE if I put a break in and then continue.. I have tried put sleep() command before the post and a process messages.  The query rescordset state is open and not executing or fecthing and I am running out of ideas.
0
 

Author Comment

by:Icart
ID: 9776130
I solved it.. Damn ADOQuery's.  I changed the query to a Client Dataset and the code worked FINE!!!  
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12328370
PAQed, with points refunded (125)

Computer101
E-E Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question