SORTing data in VB with TrueGrid 
Author Message
 SORTing data in VB with TrueGrid

This is probably a silly question, given the sophisticated readership of this
USENET group, however I'm still relatively new at some of this ...

Is there an easy/convenient way to SORT data (I'm using APEX's TrueGrid, if
that helps or matters) when tapping into an Access 2.0 database via VB 3.0
STANDARD EDITION? I've got the new compatibility layer working right, and I
seem to have overcome my initial problems in "getting up and running." Now,
after my user enters a new record, how do I reSORT without falling back on the
old brute force method of writing heaps of VBasic sort code? Isn't there some
quicker way to handle this rather basic (no pun intended) need of every db
programmer? (I guess I could do it in Access but that's of little help while
my user is editing a set of data in a VB window.)

Also, while I have your kind attention, is there a clever way to let a user
insert a record at some place OTHER than the bottom of the list of records
(again, using TrueGrid connected to an Access 2.0 database)?

Is the fact that I'm using VB 3.0 STANDARD limiting me here? Should I bite the
bullet and pop for the PROFESSIONAL upgrade?

Are you sick of my questions yet?

THANK YOU!!!

Eric Marx
_________________________________________________________________________



Sun, 19 Oct 1997 03:00:00 GMT
 SORTing data in VB with TrueGrid

Quote:

> This is probably a silly question, given the sophisticated readership of this
> USENET group, however I'm still relatively new at some of this ...

> Is there an easy/convenient way to SORT data (I'm using APEX's TrueGrid, if
> that helps or matters) when tapping into an Access 2.0 database via VB 3.0
> STANDARD EDITION? I've got the new compatibility layer working right, and I
> seem to have overcome my initial problems in "getting up and running." Now,
> after my user enters a new record, how do I reSORT without falling back on the
> old brute force method of writing heaps of VBasic sort code? Isn't there some
> quicker way to handle this rather basic (no pun intended) need of every db
> programmer? (I guess I could do it in Access but that's of little help while
> my user is editing a set of data in a VB window.)

> Also, while I have your kind attention, is there a clever way to let a user
> insert a record at some place OTHER than the bottom of the list of records
> (again, using TrueGrid connected to an Access 2.0 database)?

> Is the fact that I'm using VB 3.0 STANDARD limiting me here? Should I bite the
> bullet and pop for the PROFESSIONAL upgrade?

To re-sort, simply Refresh the recordset.  If you are using a data
control, it is Data1.Refresh.  If you are using a non-bound TrueGrid
table, re-initialize the recordset (Set ds = mydb.CreateDyanset(sql$).

There is no way to insert a record any place else than the last row
in the table.



Wed, 22 Oct 1997 03:00:00 GMT
 SORTing data in VB with TrueGrid

Quote:

>This is probably a silly question, given the sophisticated readership of this
>USENET group, however I'm still relatively new at some of this ...

[snip about how to sort]

Quote:
>Also, while I have your kind attention, is there a clever way to let a user
>insert a record at some place OTHER than the bottom of the list of records
>(again, using TrueGrid connected to an Access 2.0 database)?
>Is the fact that I'm using VB 3.0 STANDARD limiting me here? Should I bite the
>bullet and pop for the PROFESSIONAL upgrade?

OK. In VB Pro, I have done two types of sorting, one dramatically
faster than the other.

Way #1:
----------------
dim db as Database
dim ss as Snapshot
dim SQL$, FieldName$    'pretend I put a real query in SQL$, etc.

Set db = OpenDatabase("c:\users\default\mydb.mdb")
Set ss = db.CreateSnapshot(SQL)

'do stuff with ds

ss.sort = FieldName
Set ss = ss.CreateSnapshot()
----------------

And so the Snapshot recreates itself, sorted.

Way #2, the faster way...
-----------------
Dim db as Database
Dim qdf as QueryDef             'this is a stored query with a SORT BY clause
Dim ss as Snapshot

Set db = OpenDatabase("c:\users\default\mydb.mdb")
Set qdf = db.OpenQueryDef()
Set ss = qdf.CreateSnapshot()
---------------------

And so the data comes to thee pre-sorted.  I love data access objects.
Get the Pro edition; you'll be so glad you did.  You'll never have to
use one of those damned Data Controls again...

--------------------------------------------------------------
Jeff Paulsen          |


                      |
--------------------------------------------------------------



Fri, 24 Oct 1997 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Help: TrueGrid can Sort Column Value?

2. How to sort TrueGrid database display?

3. VB 3.0Pro, Access 2.0, CSVlist, TrueGrid

4. truegrid/vb...help!

5. Help with VB 4.0 & Apex TrueGrid Pro

6. Refreshing TrueGrid if Data Changed By Another?

7. Data Sort Based on Data File

8. Sort data obtain from data environment

9. Sorting mdb data and VB5 data forms

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

11. How to sort database alfabetically in vb?

12. Sort Access Tables Using VB?


 
Powered by phpBB® Forum Software