Results 1 to 3 of 3

Thread: Disappearing connections..

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    2

    Disappearing connections..

    Hi

    I am having some trouble with an ADO Command object.

    I am using a class with command and connection objects as member variables.

    The command and connection objects are initialised with the class instance.

    Method calls on my object use the command object to run a stored procedure on a SQL2000 db. The command is executed asynchronously and an event handler is in place on the connection object to handle the ExecuteComplete callback.

    Every 4 or 5 calls results in the 'Connection cannot be used it is either closed or invalid...' error. The ActiveConnection property of the command object is now Nothing.

    This is not done anywhere in the code and my object does not terminate throughout this application.

    I am tearing my hair out trying to solve this.. Does anyone have any ideas..?

  2. #2
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    There has to be a place in code where you close the connection or sets the activeconnection of the command to nothing.


    If not the only option i see that the connection is closed because it was interupted over the network ?
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    2
    Sorry swatty

    The connection object held in my object still has a valid connection, its state is ok and its errors collection is empty.

    And nowhere in the code is the command object altered aside from setting different values into the parameters until the program is ended.

    Thanks for your thoughts though.

Posting Permissions

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



Click Here to Expand Forum to Full Width