Click here to Skip to main content
15,032,256 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

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 ?
Updated 23-Feb-13 0:06am
[no name] 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

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)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900