Solved

Sorting DAO Tables in VB

Posted on 2004-05-03
9
186 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

809 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