Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordSetClone not working in Access 2000 5

Status
Not open for further replies.

cmmrfrds

Programmer
Feb 13, 2000
4,690
US
I created a new Access 2000 database and imported code from an Access mdb that was originally converted from Access 97. I used the recordsetclone to solve a couple of specific problems in the application. In the native Access 2000 mdb RecordSetClone gives me a runtime error. The error is &quot;type mismatch&quot; error 13.<br>
<br>
Am I missing libraries? Are there options that need to be set?? Or is Access 2000 just screwed up??<br>
<br>
Any ideas?
 
Did you check the DAO library?<br>
In the VBA editor click &quot;Tools&quot; menu then &quot;References&quot; <br>
Then put a Check in the &quot;Microsoft DAO 3.6 Object library&quot; <p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Yes, I went back and looked at the prior version that had been converted and found I was missing &quot;Microsoft DAO 3.6 Object library&quot; and &quot;Microsoft visual basic extensibility 5.3&quot; . I checked these off and reran the application. I still get the error, but you must be on the right track since it worked in the prior app that had been converted from Access 97.<br>
<br>
The code is simple.<br>
Dim rst as RecordSet<br>
set rst = me.RecordSetClone &lt;---- errors on this code<br>
<br>
I got out of Access and rebooted but that didn't help either. Still looking for a solution.<br>
<br>
There is one thing I did in the new APP and that is I converted the OpenRecordSet code to ADO coding since it was recommended and that works okay. Do you think there is some type of conflict here. Shouldn't be since RecordSetClone works on the Form RecordSet not the ADO Recordset. ??????<br>
<br>
<br>

 
There IS a conflice with ADO 2.1 and DAO 3.6 (other versions too, I think). So far as I know, you have to choose one or the other. Has anyone been able to have both coexist (not just the refs. checked, but actively using Recordset objects from both)?<br>
--Jim
 
Ok try this<br>
I checked the DAO 3.6<br>
and the Active-X 2.1 was already checked.<br>
This works <br>
Dim rst As DAO.Recordset '&lt;&lt;&lt;&lt;&lt;&lt; Notice the DAO.<br>
Set rst = Me.RecordsetClone<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Doug you are Wonderful!!!<br>
<br>
The DAO.Recordset worked. <br>
<br>
I may survive the day yet. I am so happy, I am going to lunch before I find any more problems and can be in ignore bliss for a while. I don't want to do too much testing yet, but I will post if there are any more problems in this area.
 
For Access 2000 I use ADODB.recordset, ADODB.connection etc. I thought I read this was the method compatible with Access 2000's default libraries, although you can use the older DAO stuff if you add add'l references.
 
Thanks Dougp...the prefix works, that's good to know...<br>
--Jim
 
Jim, re: your question can DAO and ADO coexist, I just saw something in the March 2000 issue of Office & DBA Developer magazine, p. 51:<br>
<br>
&quot;Because ADO and DAO objects have the same names, you need to fully qualify ADO object names if you're working with the ADO and DAO libraries in the same database.&quot;<br>
<br>
HTH<br>
<br>
p.s. I can't believe I have a job that allows me to actually <i>read the magazines</i> at work!!!
 
I did some further testing and everything is working fine using both DAO and ADO in the same application. Whereever, I used RecordSetClone I use DAO.Recordset, which is only in code behind a Form. In the other cases, such as, in Functions I use ADO. This is my first time using ADO and I like the syntax. It is closer to the object oriented languages like Java, which I am in the process of learning.<br>
<br>
This problem started initially because of an out of memory error in Access 2000 which was posted earlier where I had to convert to a native Access 2000 mbd. I will respond about that solution in the original post.<br>
<br>
Thanks for all the Info.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top