Solved

Sorting DAO Tables in VB

Posted on 2004-05-03
9
190 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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 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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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