Sorting a Database From VB 
Author Message
 Sorting a Database From VB

I have a database called db1 with a table call records.
I have set it up as data1 recordset.

Is there a code that will allow a sort of the table
(records). The table has mulitple fields. I want to sort
first by field1 and then by field4.

When the sort takes place will the table be permanetly
sorted so that i can print one line at a time, grabbing
each line of the table and printing it, in sorted format.

thanks
larry



Wed, 20 Jul 2005 03:35:41 GMT  
 Sorting a Database From VB
No, the idea of the database is that you have no control over the
order of records within the database.

If you want it sorted then open up the table with a SQL SELECT
statement which sorts the view.

Regards
  Malcolm Smith
  www.dragondrop.com



Wed, 20 Jul 2005 03:53:00 GMT  
 Sorting a Database From VB
Hi Larry,

Wouldn't something like:

    Me.Data1.DatabaseName = "d:\MyDocs\Access\db1.mdb"
    Me.Data1.RecordSource = _
"SELECT f1, f2, f3, f4 FROM Table1 ORDER BY f2, f4"

do the job for you?

Krgrds,
Perry



Quote:
> I have a database called db1 with a table call records.
> I have set it up as data1 recordset.

> Is there a code that will allow a sort of the table
> (records). The table has mulitple fields. I want to sort
> first by field1 and then by field4.

> When the sort takes place will the table be permanetly
> sorted so that i can print one line at a time, grabbing
> each line of the table and printing it, in sorted format.

> thanks
> larry



Wed, 20 Jul 2005 07:09:54 GMT  
 Sorting a Database From VB
In fact this is the preferred way to do it.

Malc
  www.dragondrop.com



Wed, 20 Jul 2005 08:29:10 GMT  
 Sorting a Database From VB
Was the reply and e-mail useful?

Regards
  Malc
  www.dragondrop.com



Fri, 22 Jul 2005 01:11:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. database sorting in vb

2. Fastest known sort for database access: any interest in VB implementation [updated]

3. Fastest known sort for database access: any interest in VB implementation

4. VB Front-End - Sorting Access database

5. How to sort database alfabetically in vb?

6. Fastest known sort for database access: any interest in VB implementation [updated]

7. Fastest known sort for database access: any interest in VB implementation

8. Sorting a VB database

9. Sort order - Edit Filter Sort or Quick Sort

10. Sort DAO database

11. Sorting Databases

12. VBScript and SORTing a database

 

 
Powered by phpBB® Forum Software