DATAWIDGET: Unbound DataGrid-Problem

DATAWIDGET: Unbound DataGrid-Problem

Post by Frank Spinde » Sun, 29 Mar 1998 04:00:00

If I click in the last record of the grid i get a runtime-error. This
happen, if I click in a other record first, or if I set the AllowAddNew
to true.

Can anybody help me???


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. SQL Server TimeStamp Retrieval

3. Unbound Datagrid Confusion!

4. need legacy Lotus 123 & Symphony

5. datagrid unbound columns ?

6. Memory problems with SP2

7. datagrid with unbound columns ?

8. Oracle Novell IP vs IPX

9. How to populate an unbound DataGrid?

10. weird RDO bound to datawidgets DBcombo problem

11. Combo box problem(Sheridan datawidgets)

12. Datawidgets 2.0

13. Another question on Datawidgets DBgrid...