Closing Connections

Discussion in 'ASP General' started by James, Jan 4, 2005.

  1. James

    James Guest

    What's the proper syntax for determining if a connection is open before
    closing it? Oddly enough, I can't find it on a google search.
     
    James, Jan 4, 2005
    #1
    1. Advertisements

  2. If you are doing things right you should never try and close a connection
    before it's opened.

    Ideally, I believe the best solution would be to open connection, throw
    output values into variables and then immediatly close the connection.

    Stu

    "James" <> wrote in message
    news:...
    > What's the proper syntax for determining if a connection is open before
    > closing it? Oddly enough, I can't find it on a google search.
    >
    >
     
    Stuart Palmer, Jan 4, 2005
    #2
    1. Advertisements

  3. James wrote:
    > What's the proper syntax for determining if a connection is open
    > before closing it? Oddly enough, I can't find it on a google search.


    Use its State property:
    http://msdn.microsoft.com/library/en-us/ado270/htm/mdprostate.asp

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 4, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Do
    Replies:
    2
    Views:
    484
    srinivas moorthy
    Dec 9, 2003
  2. Patrice
    Replies:
    3
    Views:
    7,350
    Michael D. Long
    Sep 22, 2004
  3. Michael D. Long

    Re: Opening / Closing SQL Server connections

    Michael D. Long, Sep 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    657
    Michael D. Long
    Sep 24, 2004
  4. darrel
    Replies:
    7
    Views:
    562
    darrel
    Oct 15, 2004
  5. bannaman

    Closing SQL Connections

    bannaman, Mar 21, 2006, in forum: ASP .Net
    Replies:
    10
    Views:
    5,436
    Juan T. Llibre
    Mar 21, 2006
  6. dustin lee

    closing database connections

    dustin lee, Jan 23, 2004, in forum: Python
    Replies:
    4
    Views:
    483
    Frank Bechmann
    Jan 24, 2004
  7. Dave V
    Replies:
    0
    Views:
    529
    Dave V
    Jun 13, 2007
  8. jobs
    Replies:
    2
    Views:
    1,150
Loading...