Passing ADODB.Connection to VB Com object error 30

Results 1 to 2 of 2

Thread: Passing ADODB.Connection to VB Com object error 30

  1. #1
    Andrew Woodward Guest

    Default Passing ADODB.Connection to VB Com object error 30

    I create a connection in the session_onstart and use this without problem in asp pages.<BR><BR>I have a VB Com object that performs some DB functions and I want to pass (by reference) the open object. <BR><BR>I have the parameter as a variant (to allow ByRef) and it appears to pass the connection object ok until I try to open a recordset against it.<BR><BR>Is this possible?<BR><BR>Regard

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing ADODB.Connection to VB Com object erro

    It may be possible but it&#039s not a good idea.<BR><BR>You should NEVER use ADO objects at Session or Application scope - there are serious threading issues which will severely limit the scalability of your application.<BR><BR>I suspect that the problem you describe may be a symptom of this - an ADO connection cannot be marshalled across thread or process boundaries.<BR><BR>You&#039d be better of passing the connection string, opening the connection inside your object, grabbing the data and closing the connection. I know that this may seem inefficient, but the whole underlying architecture is designed to support this in a very efficient and scalable manner - trying to create a single connection and hanging on to it for the entire session is a definite scalability KILLER. <BR><BR>The ADO mantra is: Create objects as late as possible and release them as soon as possible.<BR><BR>Dunc

Posting Permissions

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