Run-Time Error 13 Type Mismatch but works OK for me!

Posted on 2006-06-13
Last Modified: 2013-12-25

Whenever a friend tries to update a database (access2000) I have written he gets a Run-Time Error 13 Type Mismatch error. The code works fine for me on my laptop though. Does anyone have any ideas why??
We both are using the same version of MDAC (2.71.9030.0).

The DB is using Jet but I don't know how to check which version is installed on my laptop.

This is my Jet connection string

AConnection.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=c:\Orders.mdb;"

This is the code that updates the DB.....

AConnection.Execute "INSERT INTO table1 (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) VALUES ('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & Text10 & "','" & Text11 & "')"
Question by:wildarmsdave
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 500 total points
ID: 16893129
what are the data types of the fields a1-a10?

Author Comment

ID: 16893181
angelIII  - They are all text fields.

By the way, I've just got my friend to search his hard drive for Jet. He had the same dll version numbers as I did but was missing msjet35.dll. He's copied it to his system32 folder but it didn't fix the problem...
LVL 11

Expert Comment

ID: 16893289
Just to be explicit - is the error on the line:

AConnection.Execute ....

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 16893440
It must be as that is the only code behind the command button. I've tried the database on a few PC's at work (which are the same build/OS etc etc) as my friends (who also works with me) and I couldn't replicate the error.

I'm just wondering if he is using the same test database that I am which may explain things. I'll ask him when he gets back from lunch...
LVL 11

Expert Comment

ID: 16893489

Is there a reason you are both writing to different databases?
LVL 11

Expert Comment

ID: 16896873
Perhaps he is trying to put a null value in one of the fields that doesn't accept nulls??
LVL 11

Expert Comment

ID: 16897209
Or perhaps he is trying to insert data that includes an apostrophe??

Author Comment

ID: 16898158
angelIII 's comments got me thinking. My friend was using the same version of the test database but had been 'playing' with it and one of the data types had been incorrectly set. I'm just glad it was something simple!! Thanks to everyone for their help.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

733 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