Click here to Skip to main content
12,698,330 members (23,764 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++
int counter=0;
int Field_One=0;
bool end = false
selection[0]= mpset->First_Field



if(selection[counter] >0)

end = mpset->IsEOF();

Here is a sample of the code. It reads the first field of each record and should move on to next record until all records completed.

Hi all

I have a problem navigating my access DB , I am using the commands MoveFirst(); and MoveNext(); and checking for end of file with m_pSet->IsEOF();

What is happenng is I am running the prog and I am only reading the first record values repeatedly on running the program even though EndofFile gets set at the end of the recordset. So it is going through the recordset but not acknowledging the values in each record only the first.

I rerun the program and it goes to the last record. I have 21 fields in each record.

Can anybody help please ?
Posted 22-Feb-13 11:07am
Updated 23-Feb-13 1:06am
ThePhantomUpvoter 22-Feb-13 17:17pm
Post some code that demonstrates your problem.
CPallini 23-Feb-13 6:09am
Where are you actually reading the values? What is 'While'?
Jakey777 23-Feb-13 6:21am
While end is not true, a loop to go through the records
Jakey777 23-Feb-13 6:21am
Reading from access 97 DB table

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you only set the pointer of your reader - you need to "read" the data from the actual position in your data:

maybe this code needs to be added

selection[counter]= mpset->First_Field
Jakey777 26-Feb-13 10:30am
Thanks KarstenK I needed to get this code inside the while loop as I was only reading the data from the first record into selection and then going throught the recordset. On rerun of prog record pointer was on last record so this was read in.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100