Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing a DLL using Server.CreateObject()

Status
Not open for further replies.

jmatte

Programmer
Jan 31, 2001
6
US
Hello, I am fairly new to ASP so any help is appreciated.

I would like to access a DLL that I created using an ASP page. My code is:

'Declare object
Dim objConn

'Set object to DLL Name and Class
Set objConn = Server.CreateObject("DataUtilityDLL.cClass")

'Pass in parameters to DLL Method and retrieve back the # of rows added to database
Set intRows = objConn.addnew(param1, param2)

My DLL connects to an instance of a SQL Server Database using ADO.

When I test this using a form from VB it works but somehow when I try to access the DLL from ASP it doesn't.

Thank you in advance. :)
 
ASP uses only Variants so your DLL must have en entry point that accepts variants and if a function, returns a variant.

Also, if you want to pass an array, do not define it as
Dim myArray() because that is an array (first) of variants. You want a variant (first) that then contains an array. There is a difference.
Dim Myarray

Redim MyArray(6)

On the VB side, receive the array without ()
Public Sub FromASP(Myarray) Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top