Link to home
Start Free TrialLog in
Avatar of starkmanDev
starkmanDev

asked on

RUN-TIME ERROR '13': Type Mismatch

Hello,

 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.

Stark
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Try install latest MDAC from M$ website:

http://www.microsoft.com/Data/download.htm
Avatar of supunr
supunr

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 = ""
else
   strVal = rsRecordSet.Fields("FieldName").Value
End if


Good Luck!
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.
A simpler was of doing this that copes with null strings is

strVal = rsRecordSet("Fieldname") & ""
Avatar of starkmanDev

ASKER

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....
ASKER CERTIFIED SOLUTION
Avatar of starkmanDev
starkmanDev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
starkmanDev:
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?
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