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!

Recordset order

Status
Not open for further replies.

RobJDB

Programmer
May 13, 2002
44
GB
I want to open a recordset with ADO. I want to order it by the primary key (called "ID" in this case). Trouble is, another field in the table is indexed, so my rs comes in in a weird order. How can I ignore the index and just order my rs by the ID field?

Cheers,
Rob
 
select * from table
ORDER BY id

hth Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Thanks Bastien. I knew about ORDER BY, but something else is going wrong. Looking more closely, it seems my recordset is actually in the correct order, but as I copy its records one by one into a new table, they go out of order in the new table. Could this be because the new table has no primary key defined?
If so, then how do I define a primary key for a new table?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top