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
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
make sure when you are copying values from a recordset to a string use the follow format.
strVal = "" & rsRecordSet.Fields("FieldN ame").Valu e
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 ("FieldNam e").Value) ) then
strVal = ""
else
strVal = rsRecordSet.Fields("FieldN ame").Valu e
End if
Good Luck!
strVal = "" & rsRecordSet.Fields("FieldN
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
strVal = ""
else
strVal = rsRecordSet.Fields("FieldN
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") & ""
strVal = rsRecordSet("Fieldname") & ""
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("FieldN ame").Valu e 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....
Argh .. I am looking for a tall building....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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
Moderator, my recommended disposition is:
Refund points and save as a 0-pt PAQ.
DanRollins -- EE database cleanup volunteer
http://www.microsoft.com/Data/download.htm