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. Advertising

  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. Advertising

  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. Advertising

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:
    377
    srinivas moorthy
    Dec 9, 2003
  2. Patrice
    Replies:
    3
    Views:
    7,162
    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:
    502
    Michael D. Long
    Sep 24, 2004
  4. Michael D. Long

    Re: Opening / Closing SQL Server connections

    Michael D. Long, Sep 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    Michael D. Long
    Sep 22, 2004
  5. jobs
    Replies:
    2
    Views:
    917
Loading...

Share This Page