Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data2.recordset.moveNext problem 1

Status
Not open for further replies.

lesina

Programmer
Apr 10, 2001
76
ES
Hi everyone

i'm making a vb6 programm and i'm having a problem.
Here it goes:
my programm reads from an acess database, i get it's data using a data(vb control) and with it, i can delete, change, look for, whatever record.
Well, one of the tables has an id for primary key and the problem is here.
when i create a new record, this id is automatic and it's bigger than the last(so that i have no repeated records id).
Some of the times, i have unordered id's because i insert and delete records and change others.
So, at this point i have id's ordered this way:
21
22
43
44
45
48
8
6
27
49
50
and my problem is that i have a cicle and i use .recordset.movenext to change from one record to the next.
But the anormal is going from record id=48 to the one with id=49 and letting records between without belonging to the cicle.
What's happening?
Can anyone help me?

Thanks in advance, ===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
CPC_TA- Braga
-------------------
Portugal
===================
 
Try using this to open your record set

"Select * From myTable Order By myID Asc"

If you choose to battle wits with the witless be prepared to lose.
[machinegun][ducky]
 
Hi foada,

you're a genious!
That's something so easy and so stupid of me not to remember.

Thanks a lot!
a star for you.

good work ===================
* Marta Oliveira *
===================
marta100@aeiou.pt
-------------------
CPC_TA- Braga
-------------------
Portugal
===================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top