ADO Recordset

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

I'm trying to open an ADO recordsetclone using the
following code but I keep getting a Type mismatch error.
I believe I have the reference(s) to the ADO.

Dim RecClone As ADODB.Recordset

Set RecClone = Me.RecordsetClone

I'm relatively new to using the recordset object. I'm not
even sure whether to use ADO or DAO. But any
information will be appreciated.

Thanks,
James
 
JamesJ wrote in message said:
I'm trying to open an ADO recordsetclone using the
following code but I keep getting a Type mismatch error.
I believe I have the reference(s) to the ADO.

Dim RecClone As ADODB.Recordset

Set RecClone = Me.RecordsetClone

I'm relatively new to using the recordset object. I'm not
even sure whether to use ADO or DAO. But any
information will be appreciated.

Thanks,
James

Hi!

If you are using and Access database, and not an Access project (ADP),
you will be working with DAO (unless you've assigned an ADO recordset
as the form recordset).

Dim RecClone As DAO.Recordset
Set RecClone = Me.RecordsetClone

Ensure you have a reference to Microsoft DAO library
(in VBE - Tools | References)
 
I don't get the error message when using DAO.Recordset
So in order to use ADO I must be using an Access project as
opposed to an Access database?

Thanks,
James
 
JamesJ wrote in message said:
I don't get the error message when using DAO.Recordset
So in order to use ADO I must be using an Access project as
opposed to an Access database?

Thanks,
James

Where to start;-)
- shortening a long discussion into a little reply - you'd probably
find
lot more, both of discussions and opinions by a little search, but I'll
try to be objective (and appreciate corrections).

You can use ADO whenever you wish (with the exception of manipulating
the form recordset, se below), but you'll find DAO faster on native
Access tables, probably also linked Access tables. In fact, lot of
Access
developers prefer DAO for that reason.

ADO became the default library starting with Access 2000, was so in
2002
(xp) ('twas just to check the DAO reference, though, to make it
available),
but in 2003, both libraries became "checked" by default.

But - relating to this question - in all versions, the form recordsets
are DAO,
unless
1 - you're working with ADP's
2- you explicitly assign a ADO recodset to the form (which is a hassle
in
the 2000 version, but OK for the later versions)

See http://support.microsoft.com/kb/281998/EN-US/
 
Thanks much. Yes, it is a large subject.
You've been very helpful.

Thanks again,
James
 
Back
Top