Solved

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

Posted on 2006-06-13
8
1,765 Views
Last Modified: 2013-12-25
Hi,

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 & "')"
0
Comment
Question by:wildarmsdave
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
what are the data types of the fields a1-a10?
0
 

Author Comment

by:wildarmsdave
Comment Utility
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...
0
 
LVL 11

Expert Comment

by:pootle_flump
Comment Utility
Just to be explicit - is the error on the line:

AConnection.Execute ....

??
0
 

Author Comment

by:wildarmsdave
Comment Utility
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...
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Expert Comment

by:pootle_flump
Comment Utility
Hi

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

Expert Comment

by:leclairm
Comment Utility
Perhaps he is trying to put a null value in one of the fields that doesn't accept nulls??
0
 
LVL 11

Expert Comment

by:leclairm
Comment Utility
Or perhaps he is trying to insert data that includes an apostrophe??
0
 

Author Comment

by:wildarmsdave
Comment Utility
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.
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

Suggested Solutions

Title # Comments Views Activity
Problem to the message 13 62
VBA saving file message display 5 47
Run code from text file in vb 1 32
How does CurrentUser work? 10 25
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 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

12 Experts available now in Live!

Get 1:1 Help Now