Sorting DAO Tables in VB

Posted on 2004-05-03
Last Modified: 2010-05-02
I've got an application developen in VB using DAO to open Access Database file. My problem is how to sort the record sets when thy are opened as a Table. Indexes can not be used in Table mode!
Question by:progex
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 53

Expert Comment

ID: 10976452
How do you assign your table to the dao-recordset ?
Otherwise you can give it a order by clause when you open your recordset: "select * from yourTable order by YourField"

Author Comment

ID: 11002889
well, i'm using the opendatabase function of the database object to open the recordset and set it to the record set object as follows:

set data_rs = data_db.opendatabase("database name", "table name, dbOpenTable)

no sorting option in here!!!

Author Comment

ID: 11002895
isn't there a method with the recordset object to reorder the table??
What about the sort methord of the recordset object???
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 53

Accepted Solution

Dhaest earned 300 total points
ID: 11002903
set data_rs = data_db.openrecordset("select * from tableName order by YourField", dbOpenDynaset)
LVL 53

Expert Comment

ID: 11422982
My recommandation: answered by Dhaest, because there was no reaction after my comment, so I guess that it the asker was satisfied about my comment.

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question