Solved

OpenRecordset type mismatch error 13

Posted on 2002-06-10
3
1,075 Views
Last Modified: 2008-03-17
Here is my code:

Dim db3 As Database
Dim rsttemp As RecordSet
Set db3 = CurrentDb()
Set rsttemp = db3.OpenRecordset("tblTempArchPart")

On the set rsttemp line I get the following error:
Run time error '13'
type mismatch

I have tried including a second parameter such as dbOpenDynaset or dbOpenTable - neither makes a differenc.

The table is not a linked table - it has one record in it.
I have the Microsoft DAO 3.6 object library as one of the references.

Any ideas????
0
Comment
Question by:llap
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 7067060
Try this:
Dim db3 As DAO.Database
Dim rsttemp As DAO.RecordSet

The problems is that you might have other references that have a Recordset type, which could be in the list before the DAO.records.

CHeers
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 7067117
If this is happening with Access 2000, the problem arises because the DEFAULT data access technology for Access 2000 is ADO, but the default type when you Dim ...as Database is DAO  Thus, you get a DAO recordset from the OpenRecordset method of the Database object, but the Dim ... as Recordset has declared the Recordset object as an ADO-type recordset, hence the Type mismatch.  as Angelll suggested, you can resolve the issue by EXPLICITLY declaring the Database and Recordset objects as DAO.
0
 
LVL 1

Author Comment

by:llap
ID: 7067262
"DAO." was the problem --- thanks! Appreciate Arthur's more definitive explanation -- but will accept angel's answer because it worked and it was posted 1st. Thanks again!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question