I am currently working on a relatively complex 2-tier Visual basic project (using an AS400/DB2 database), on which I have encountered the following interesting but strange problem. One of the features of the program doesn’t work in the executable when the executable is run on a computer without VB6/Visual Studio installed, but it runs without any problems on any computer that has VB6/Visual Studio installed.
To be more exact the error appears when a button is pressed that loads a form that contains a normal textbox and a multiline textbox. This form directly reflects a record from a table in the Database. If the form is opened in new mode (i.e. a corresponding record doesn’t exist in DB) the user is able to paste/type any text in the multiline textbox. When he presses the save button a record is inserted in the database. Then the user is able to edit that record. The error message (error 13, type mismatch) appears at exactly that point i.e. when the system tries to load and assign the text (it is a varchar field of about 10000 characters) in the multiline text box.
For all database operations the program uses well-tested libraries, implemented through visual basic 6 classes. The libraries are in that system for more than a year now and they have been used successfully in similar situations (i.e. multiline textboxes).
Another fact might be important is that the system is consisted of three visual basic 6 projects. One executable and two DLLs. The problem appears in one of the two DLLs, actually the most complicated and big one of the two.
The exact source code line at which this problem appears cannot easily be determined because the error doesn’t appear when it is run through visual studio debugger since visual studio is installed on that computer. I have also checked the text that was put for any strange characters but it seems to contain only ASCII characters
Does anyone have any explanations/ideas how to fix it? I have started putting msgboxes at various places in the flow of the program but it is a very difficult hard since it takes approximately an hour to compile
. Is anyone aware of any tools that will help me debug the runtime executable?