Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

type Mismatch error 13

Posted on 2002-04-17
4
Medium Priority
?
326 Views
Last Modified: 2010-05-02
I need help. Why the type mismatch.
I copied the code from another of my programs and there is no error in the other program. tbl.name is a string.


Dim dbmath As Database
Dim rs As Recordset
Dim ws As Workspace

Set ws = DBEngine.Workspaces(0)
Set dbmath = ws.OpenDatabase(NuevaDB$ + ".mdb")
'next statement gives 'type mismatch' WHY?
Set rs = dbmath.OpenRecordset(tbl.Name, dbOpenDynaset)

0
Comment
Question by:mathprof
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 400 total points
ID: 6949254
Remove reference to MS ADO 2.x, or move it down to have less priority than DAO 3.x, or change declaration:
>Dim rs As Recordset
to
Dim rs As DAO.Recordset
0
 
LVL 3

Expert Comment

by:dannic
ID: 6949276
Hi mathprof,

What DAO Library do you use?
The code works with a reference to Microsoft DAO 3.6 Object Library.

Make sure that tbl.Name contain a valid tablename.
0
 

Author Comment

by:mathprof
ID: 6949335
Brilliant.
I changed the dim statement.
And thanks for your speedy response. I never would have figured this one out!
Mathprof
0
 
LVL 15

Expert Comment

by:ameba
ID: 6949338
Thanks  :-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

927 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