Click to See Complete Forum and Search --> : Calling DLL in VBScript


Deepa
February 19th, 1999, 03:00 PM
Hi,


I am developing an application in ASP, the code is written in VB ( ActiveX DLL's are created)

and they are called in ASP . I checked first by writing a DLL which makes square of the integer that is passed and returns the result back which worked fine when it was called in ASP!

But, then I wrote a DLL which was accessing the MS Access database with ADO and returning a string... When I call this DLL, I get an error saying that ODBC error DSN not fount ! The same DLL works fine when called in VB or when I debug it from Dll itself by using a breakpoint (stop) in ASP!

Also I wrote another DLL which was logging on to the Exchange server and posting a message to a folder. The DLL when called in VB it works fine or when it is debugged from DLL to ASP it works fine, but if I run the ASP code the error is Logon failed MAPI_error etc. etc.

I have come to the conclusion that when the DLL is referring to some other object such as OCX or DLL the ASP code does not work but, for the mathsquare DLL the project did not reference any object than the default ones so that works! So my ASP code does not recognize the ADO or Exchange objects!

Can you please help me about it?

I have Visual Studio 6.0 and Windows NT 4.0, MS Exchange 5.5, ADO 2.0

Thanks,


Deepa

James Grant
April 1st, 1999, 04:05 PM
For the ODBC error:
You have an ODBC datasource "DSN" on your machine. Your code relys on this DSN which is unique to your machine. This DSN is likely not on your webserver. You have two choices:
1. Manually create the DSN on every machine where the DLL will run (this sucks)
2. Change your connection to not use a DSN. There is documentation on this in MSDN.

September 3rd, 1999, 06:17 AM
For ASP application you must be using either IIS or PWS(Personal Web Server). When a HTML Page is submitted to ASP Script(Which is stored under Home Directory of the Web Site Created using IIS/PWS),the ASP Script is always executed on the system in which IIS/PWS is installed.

So You must be having, ADO Component and DSN For Accessing the Database where IIS/PWS is installed.

As you are using ADO you can also connect to database without creating DSN, just by specifying the Connection String.


VMK

(vmkrish@yahoo.com)