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

    Unanswered: ASP & SQL Server 2000 Connection

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

    CODE::::::::::::::::::::::::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

    ERROR:::::::::::::::::::::::ERROR::::::::::::::::: :::::::::

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

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245

    Re: ASP & SQL Server 2000 Connection

    Add conn.Open before your rs.Open statement.

    Regards,

    Hugh Scott

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

    CODE::::::::::::::::::::::::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

    ERROR:::::::::::::::::::::::ERROR::::::::::::::::: :::::::::

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

Posting Permissions

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