Forms Bound to Recordsets

  • Thread starter Thread starter Mike Miller
  • Start date Start date
M

Mike Miller

I have a question about the Access Projects and bound forms. Which type
of Recordset object do they use, ADODB, OR DAO? I ran into some issues with
an Access front-end application when trying to hand a form an
ADODB.Recordset in code (maybe it can be done, but before the form is loaded
into memory?). I would think that since SQL Server is the back-end for an
ADP that the ADODB Recordset object would be used.

Thanks for your help,

--Micah
 
They can use both. See http://support.microsoft.com/?id=281998 for a full
explanation.

When retrieving a recordset, both ADODB or DAO recordset can be retrieved.
However, a common error is to forget using the "new" keyword when retrieving
an ADODB recordset:

Private Sub cmdRecordset_Click()
Dim rst As new ADODB.Recordset
Set rst = Me.RecordsetClone
rst.MoveFirst
Do
Debug.Print rst!LastName
rst.MoveNext
Loop Until rst.EOF
End Sub

The error is to write only "Dim rst As ADODB.Recordset" instead of "Dim rst
As new ADODB.Recordset".

S. L.
 
Back
Top