Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    11

    Unanswered: find if ACTIVE Connection

    is ther any way to response.write on a page if there is abn active connection to database?

  2. #2
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    can you clarify this please?

  3. #3
    Join Date
    Mar 2003
    Posts
    11
    i have put a 4 select options on one page in a frameset, populated therm from the datasbase and closed connection. But as i am a complete newbie at this and with so many select box and Connections i am confused, and i wanted to be able to check that the connection was not always 'open'.

  4. #4
    Join Date
    Jan 2003
    Posts
    23

    Hope This Helps

    'Create RecordSet'''''''''''''''''''''''''''''''''''''''
    Dim objRecordset
    Set objRecordset = Server.CreateObject("ADODB.recordset")
    objRecordset.ActiveConnection = strConnection ' = Your Connection String
    objRecordset.CursorLocation = 3
    objRecordset.LockType = 3
    objRecordset.CursorType = 0
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''

    'Open RecordSet''''''''''''''''''''''''''''''''''''''''' '
    objRecordset.Source = strSQL '=Your Qurey
    objRecordset.Open
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''

    'Check if state is open And Close'''''''''''
    'Enum Values
    '0 The object is closed.
    '1 The object is open.

    If objRecordset.State = 1 Then objRecordset.close
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''

  5. #5
    Join Date
    Mar 2003
    Posts
    11

    Talking

    thanks folks, that is perfect pjames. Thank you!

  6. #6
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    remeber to set all your objects to nothing!
    Code:
    'close the rs
    set rs=nothing

Posting Permissions

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