Solved

OpenRecordset type mismatch error 13

Posted on 2002-06-10
3
1,072 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now