Order a recordset

How can I "order by asc" a recordset which is just filled with records?
Should I use the db.execute command?
I use the addnew command to fill up the recordset and then I need it ordered by a given field
Who is Participating?
SiM99Connect With a Mentor Commented:
how do you fill the recordset in the first place?

using SQL, you would simply change it to have 'ORDER BY thisfield'

e.g. SELECT * FROM thistable WHERE thisistrue ORDER BY fieldname
Éric MoreauSenior .Net ConsultantCommented:
Which database method access are you using? If you use ADO you use this:
rs.sort = "FieldName asc"
I think he wants to sort the physical order of the records in the database after they are written.  i.e. re-organize them according to a key field.

He could order them using SQL and ASC as others have said then read them one by one from the file and write them one by one in order to a new image file, then delete the old file and copy image file to original file.

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

With SQL Server you could drop and recreate a clustered index.
SELECT * FROM TableName WHERE selectcriteria ORDER BY field1 ASC , field2 ASC
neyAuthor Commented:
I accept your answer even though I thought there was a metod to directly Order a recordset without making a second sql call.
Thank you
All Courses

From novice to tech pro — start learning today.