Connection Object passed to a DLL

Results 1 to 2 of 2

Thread: Connection Object passed to a DLL

  1. #1
    Join Date
    Dec 1969

    Default Connection Object passed to a DLL

    Hi everybody, somebody help me please<BR><BR>I have made a DLL (named CategoryTree) in VB and defined a property set as gievn below in that DLL<BR><BR>Public Property Set Connection(ConnectionObject As ADODB.Connection)<BR> Set objCon = ConnectionObject<BR>End Property<BR><BR>Now i use the following code in ASP to set this property<BR>Set cn=Server.CreateObject("ADODB.Connection")<BR>cn.O pen "BDirData2T"<BR>Set CategoryTree.Connection=cn<BR><BR>Now the problem is as soon as this connection object is used somewhere inside this DLL to open any recordset, it generates this error.<BR><BR>Runtime error &#039 3001&#039<BR>Arguments are of wrong type, or out of exeptable range, or are in conflict with one another.<BR><BR>As you can see i am passing this Connection object to this DLL and it is generating error, but if i open this Connection Object inside that DLL, it works fine.<BR><BR>Could any body guide me please.<BR><BR>Interesting thing is this error is not there on one computer but is there on my computer.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Connection Object passed to a DLL

    You are passing a reference to an OBJECT 2 times.<BR>it will generate an error. Try and set a FUNCTION instead of a property and inside it declare the conn string.<BR><BR>Good luck.<BR><BR>lawrence B.

Posting Permissions

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