How to reference recordsetclone property with ADODB

  • Thread starter Thread starter Christian Sawyer
  • Start date Start date
C

Christian Sawyer

Hi there,
I'm using a lot of old code with DAO method.
Now many of this code have to be converted with ADODB
method. In many forms, I have a lot of references to the
recordsetclone property like me.recordsetclone.control.tag
= Value1.
It seems that I cannot use this syntax with ADODB.
How can I reference the recordsetclone with ADODB?

Any help will be appreciated.
Thank's
 
Christian Sawyer said:
Hi there,
I'm using a lot of old code with DAO method.
Now many of this code have to be converted with ADODB
method. In many forms, I have a lot of references to the
recordsetclone property like me.recordsetclone.control.tag
= Value1.
It seems that I cannot use this syntax with ADODB.
How can I reference the recordsetclone with ADODB?

Any help will be appreciated.
Thank's

I'm a bit confused, as a DAO recordset such as is returned by the
RecordsetClone method in an .mdb file doesn't have a Control property,
AFAIK. Maybe if you gave some examples of the specific properties
you're concerned with, we could address those issues.

Are you working in an .adp, and is that why you're using ADODB
recordsets? I ask because in an .mdb the Form.RecordsetClone method
normally returns a DAO recordset anyway. And you can use DAO instead if
ADO in an .mdb file in any version of Access -- it's more efficient if
you're working with a Jet database as opposed to, say, SQL Server. Just
because A2K and A2K2 don't give you a reference to DAO by default
doesn't mean you can't add one and then work with DAO objects to your
heart's content.
 
Hi, ok, here a simple example.

That one work fine.
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone

That one doesn't (type mismatch)
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone

Probably just a syntax error. I don't know.
 
Christian Sawyer said:
Hi, ok, here a simple example.

That one work fine.
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone

That one doesn't (type mismatch)
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone

Probably just a syntax error. I don't know.

That one doesn't work because the RecordsetClone is a DAO recordset, not
an ADODB recordset.
 
Christian Sawyer said:
OK, so, how do I need to declare it and use it?

Thank's

Exactly as you originally did:

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

I'll say it again: if you are working in an .mdb file, the
RecordsetClone property normally refers to a DAO recordset. The only
time it doesnt, AFAIK, is if you have set the form's Recordset property
yourself, to an ADODB recordset. If you're working in an .adp, then the
RecordsetClone returns an ADODB recordset.
 
Back
Top