Solved

Doing SELECT, GROUP, ORDER on .DBF files ?

Posted on 1998-12-30
1
220 Views
Last Modified: 2013-12-25
Hi,
i am using the following to open & access a .dbf file:
Set Db = Ws.OpenDatabase(App.Path,True,False,"dBASE IV")

To move the pointer, or do the next search:
Set Rs = Db.OpenRecordset("SELECT * FROM...WHERE...", dbOpenForwardOnly)

My Question:
The above selects line by line. If so, how can i do a GROUP, ORDER(ie.sort) on a selected list of results from a .DBF file ?? Or what would be the optimal way to do ?

Thanks for your advise,
Collin
0
Comment
Question by:collinng
[X]
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
1 Comment
 
LVL 3

Accepted Solution

by:
vbWhiz earned 50 total points
ID: 1498610
To sort by a field simply add an 'ORDER BY' clause to the SELECT statement.

for ascending order
SELECT FROM... WHERE... ORDER BY tbl.fld;

for descending order
SELECT FROM... WHERE... ORDER BY tbl.fld DESC;

multiple fields to sort
SELECT FROM... WHERE... ORDER BY tbl.fld1, tbl.fld2 DESC, tbl.fld3;

So when you grab the first row it has already been sorted and is the first row in the sort order.


I hope this helps you out!
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

729 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