DLL works when called from VB but error on the Web

Results 1 to 3 of 3

Thread: DLL works when called from VB but error on the Web

  1. #1
    Thesync Guest

    Default DLL works when called from VB but error on the Web

    I have written a DLL that parses a text file and then returns the results after it is finished. This DLL has a Public funtion in it that accepts 2 parameters. 1 the file to be parsed and 2 the connection string to a SQL server so it can compare the file to the database. I wrote and compiled the DLL then decided to test it in VB first so I created a new standard exe and loaded the dll as a reference. Then i created a label and a cmd button on my form to initiate the process and then populate the label with the results from the dll. then i wrote the code for the button so it will create an instance of the dll and send it the file and the connstring and then return the results in the label. well this worked fine. Then when i got to the web and register it in MTS then try to do the same on the asp page it gives me back Type Mismatch error. The strings im sending the dll function are identical to the ones i did in the vb exe.. i have even tried cstr() on the string when i send them... any ideas on what is happening? I have tried this dll on NT 4 server with IIS 4 and also on win2k adv server with IIS 5. Any help is appreciated..<BR><BR>I just curious as to why the type mismatch error doesn&#039t show up in vb when i call the dll..<BR><BR>thanks<BR><BR>This is also a Crosspost from the moderated Com/Com+ forum since im not sure how long it will take to get authorized.<BR><BR>Thesync

  2. #2
    Steve M Guest

    Default RE: DLL works when called from VB but error on the

    Save yourself a lot of grief and declare all of your dll&#039s parameters as Variant. You can sanity check them inside the dll with VarType in self-defense if you want to, but to ASP everything is a Variant, so if you can&#039t beat &#039em join &#039em.<BR><BR>hope it helps.

  3. #3
    Join Date
    Dec 1969

    Default Or

    Pass your parameters in BYVAL. This clears up type mismatches in 99.8% of cases<BR><BR>Public Function testMe(ByVal myString As String) As Variant

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts