Solved

Sorting DAO Tables in VB

Posted on 2004-05-03
9
180 Views
Last Modified: 2010-05-02
Hi...
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!
0
Comment
Question by:progex
  • 4
  • 2
9 Comments
 
LVL 53

Expert Comment

by:Dhaest
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:

rs.open "select * from yourTable order by YourField"
0
 
LVL 1

Author Comment

by:progex
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!!!
:(
0
 
LVL 1

Author Comment

by:progex
ID: 11002895
isn't there a method with the recordset object to reorder the table??
What about the sort methord of the recordset object???
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 53

Accepted Solution

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

Expert Comment

by:Dhaest
ID: 11002928
0
 
LVL 53

Expert Comment

by:Dhaest
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.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now