Unbound Datagrid Confusion!

Unbound Datagrid Confusion!

Post by Steve » Wed, 20 Aug 1997 04:00:00

My users have gotten used to a grid showing all the records within a DAO
Query with a data entry section above it.  I've gotten VB5 Enterprise and
used it for several successful apps with a generic RDO Class.   My Problem
is that I can't figure out how to emulate a bound datagrid.  Everything
I've done is slow, and i can't figure out a quick way to show Updated data.
 This grid needs to hold up to 5,000 records at a time for quick scrolling
and summary/counting purposes.  Any Ideas?


1. Datagrids, Unbound Forms & ADO

Hi!  In the past, I have used ADO controls and bound forms for database
access, but now have a need to use an unbound form, and fill a datagrid
control with data.

I declare the following for the form "frmCharter":

Dim mcnCharterApp As Connection
Dim mrsCharter As Recordset

Next, at the Form Load event, I use the following code to establish the
link to the database:

    Set mcnCharterApp = New Connection
    Set mrsCharter = New Recordset
    mcnCharterApp.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        " Data Source =" & databasePath & ";"

where databasePath is a variable containing the fully qualified path to
my database. (an Access 2000 database).

Now, I want to get all of my records for the date specified, so I use
the following to load up my recordset:

    strQuery = "SELECT
& _
                " WHERE ([CHARTER].[CHARTER_DATE_OF_CHARTER] = #" & _
               Calendar1.Value & "#" & _
                " AND ([CHARTER].[CHARTER_AM_OR_PM_TRIP] = '" & sAMPM &
    mrsCharter.Open strQuery, mcnCharterApp, adOpenKeyset, _
                    adLockOptimistic, adCmdText

Finally, I set the record source for my grid control (grdCharter) as

    Set grdCharter.DataSource = mrsCharter

My question is as follows:  What do I need to do to populate the
information in the recordset into the datagrid.  In the past, when I
have done this with a bound form (datagrid to the ADO control on the
form), this all happened automatically.  It doesn't seem to be happening
this way now, and I suspect that I need to load the form up through

Any thoughts?



2. JDBC Drivers for SQL Server 7

3. How to populate an unbound DataGrid?

4. NY-NEW YORK-11001--ORACLE-DBA Skills-Database Administrator

5. Some confusion with ADO and datagrid

6. Geneal SQL error

7. datagrid with unbound columns ?

8. Some confusion with DataGrid

9. Some confusion with ADO and DataGrid

10. datagrid unbound columns ?

11. DATAWIDGET: Unbound DataGrid-Problem

12. Copy from Datagrid to datagrid