Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    14

    Post Unanswered: ASP Connections to SQL Server 2000

    I am receiving the following error message when attempting to connect to SQL Server 2000.

    Please help me!

    HERE'S THE ERROR:::::::::::::::::::::::ERROR::::::::::::::::: :::::::::
    -------------------------------------------------------------------------------

    ADODB.Recordset (0x800A0E7D)
    The connection cannot be used to perform this operation. It is either closed or invalid in this context.


    HERE'S THE CODE USED::::::::::::::::::::::CODE:::::::::::::::::::: ::::::
    -----------------------------------------------------------------------------

    Dim conn, strSQL, rs

    set conn = Server.CreateObject("ADODB.Connection")
    conn.ConnectionString = "driver={SQL Server};" & _
    "server=SF0039;" & _
    "Address=10.108.1.58,1433;" & _
    "Network=CHICAGO;" & _
    "uid=remote;" & _
    "pwd=remote;" & _
    "database=heat601;"

    strSQL = "Select custid from subset"
    set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open strSQL, conn

  2. #2
    Join Date
    May 2002
    Posts
    299

    Re: ASP Connections to SQL Server 2000

    Here is some great page for connection string...

    http://www.able-consulting.com/MDAC/...erForSQLServer
    --
    -oj
    http://www.rac4sql.net

  3. #3
    Join Date
    Feb 2003
    Posts
    8

    Re: ASP Connections to SQL Server 2000

    You should open first the connection.

    Try this:

    Dim conn, strSQL, rs

    set conn = Server.CreateObject("ADODB.Connection")
    conn.ConnectionString = "driver={SQL Server};" & _
    "server=SF0039;" & _
    "Address=10.108.1.58,1433;" & _
    "Network=CHICAGO;" & _
    "uid=remote;" & _
    "pwd=remote;" & _
    "database=heat601;"
    conn.Open

    strSQL = "Select custid from subset"
    set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open strSQL, conn

    Originally posted by Terry Ward
    I am receiving the following error message when attempting to connect to SQL Server 2000.

    Please help me!

    HERE'S THE ERROR:::::::::::::::::::::::ERROR::::::::::::::::: :::::::::
    -------------------------------------------------------------------------------

    ADODB.Recordset (0x800A0E7D)
    The connection cannot be used to perform this operation. It is either closed or invalid in this context.


    HERE'S THE CODE USED::::::::::::::::::::::CODE:::::::::::::::::::: ::::::
    -----------------------------------------------------------------------------

    Dim conn, strSQL, rs

    set conn = Server.CreateObject("ADODB.Connection")
    conn.ConnectionString = "driver={SQL Server};" & _
    "server=SF0039;" & _
    "Address=10.108.1.58,1433;" & _
    "Network=CHICAGO;" & _
    "uid=remote;" & _
    "pwd=remote;" & _
    "database=heat601;"

    strSQL = "Select custid from subset"
    set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open strSQL, conn

Posting Permissions

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