RUN-TIME ERROR '13': Type Mismatch

Posted on 2003-03-05
Medium Priority
Last Modified: 2010-05-01

 I am packaging an application on a winxp box (using mdac  2.7) and deploying to a win2k box (which has mdac2.7 as well). It keeps giving me "Runtime error '13': Type mismatch". THis is driving me insane..i am supposed to roll this app out in 1 month and i am totally stuck.

I am quite sure it has something to do with MDAC versioning or something cuz i am using ado 2.7 as a reference in the vb project.

Interestingly enough, if i copy the source code from the xp box and put it right on the client (win2k box) i am trying to deploy to (it has vb on it), everything works ok.

Thanx in advance for help.

Question by:starkmanDev
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
LVL 53

Expert Comment

by:Ryan Chong
ID: 8077782
Try install latest MDAC from M$ website:

LVL 11

Expert Comment

ID: 8077785
make sure when you are copying values from a recordset to a string use the follow format.

strVal = "" & rsRecordSet.Fields("FieldName").Value

because if the field name contains a NULL, then you get the type mismatch error.  So first you convert these nulls to empty strings by doing "" & .  This should solve your problem.

Also use similar format if you want to do comparisons in if statements.  Otherwise you have to check if the field value is null and it is bit of work.

to check if field value is null you have to use

if (IsNull(rsRecordSet.Fields("FieldName").Value)) then
  strVal = ""
   strVal = rsRecordSet.Fields("FieldName").Value
End if

Good Luck!
LVL 11

Expert Comment

ID: 8077793
do what i have mensioned above for all the text fields in the database which are nullable.  Specially optional fields like Address, Fax Email, etc.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 8079089
A simpler was of doing this that copes with null strings is

strVal = rsRecordSet("Fieldname") & ""

Author Comment

ID: 8082246
Thanks all for responses. I believe i have the latest MDAC (2.7), but i think the problem lies in some scripting runtime issue (scrrun.dll?). By the way i am not using the rsRecordSet.Fields("FieldName").Value convention at all because i have a class that wraps ADO(and this class has been well tested and used and runs currently in many of our production apps at work). That's why i don't believe it is even ado anymore, but some way that the app is interpreting strings. The app installs fine from the package on the client machine, but as i said above when you open it from the start menu, you get "Runtime error '13': Type Mismatch"

Argh .. I am looking for a tall building....

Accepted Solution

starkmanDev earned 0 total points
ID: 8082779
After explaining it with someone else, i solved my own problem. What i failed to do was include an ini settings file that contains the settings for which database/server to hook up to.

Thank you however for your responses!


Expert Comment

ID: 8900598
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 9074119
starkmanDev, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

741 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