-
Hi there I just wrote a small data access application that reads from a SQL 7 database, writes the result to a text file, and then using a 3rd party email component, emails the text file to another address.
The problem is that when I install the executable on the machine that it is supposed to run on, I get a runtime error '13', Type mismatch. I get this error after the program runs. The program works, just this message box pops up, at the end.
What's also weird, this doesn't happen on my development machine, only the other one. The host machine has the VB runtime libraries installed as well as the dll's that belong to the 3rd party email component.
My app uses ADO 2.1, which the host machine didn't have the dll for, thus I copied it into the c:\Program Files\Common Files\System\Ado folder. Unfortunately that didn't work. So I recompiled the app using ADO 2.0 which the host machine did have the dll file for. Alas that didn't work either.
The host machine runs NT4 w/ service pack 5. The development machine runs Win 2K Pro. Any help would be greatly appreciated as this app will run as a SQL 7 job and will be part of a larger solution. Thanks in advance.
Regards,
Jack Vinitsky
-
Be sure you have in all of your Modules and Forms. At compile time it will hopefully trap your problem.
Hope this helps.
-
Nope, Option Expicit is there. I have no problems running the executable or compiling it on the development machine. All the trouble happens on the host.
-Jack Vinitsky
-
Hi JackV
Be sure you didn't put any On Error Resume Next statement inside your code, If yes, just change it to others like On Error Goto ABC_Err and try to trap the error location. Instead of guessing here & there.
:)
-
Is the type mismatch occuring when emailing by any chance?
-
Is the "Break On All Errors" turned on ?
Probably that might help you get to the code giving the error.
-
Hi all, thanks for all your help.
My program is divided into 4 function calls. I put message boxes after each function call and found out that the last function, which updated a log file using File System Objects wasn't running.
It turned out that the scrrun.dll (Micosoft Scripting Runtime) on the host machine wasn't functioning. So I copied it from the development machine onto the host machine. Though my boss wasn't too happy with me changing dll's on one of his servers, everything seems to work now.
After I found which function was causing the problem, I numbered each line and then used a litte known function call "erl" in an error handler which then told me what line the error was occuring. Here is the message box command I used after numbering each line:
ErrTrap:
msgbox err & " " & error & " in function xyz in/after _ line: " & erl
Hope this helps others.
--Jack Vinitsky