Results 1 to 7 of 7

Thread: SQL 2000 Named Instance Issue

Threaded View

  1. #1
    Join Date
    Jan 2007
    Posts
    4

    SQL 2000 Named Instance Issue

    Hello, can anyone help with this question? I have a SQL Server 2000 machine with both a default (SQL4) and named instance(SQL4\CONTROL). They are both running in mixed mode, and the named instance is set up with TCP enabled (along with named pipes) on port 1434, while the default is still on 1433. Here's the problem - I can access the named instance perfectly through Enterprise Manager, Query Analyzer, etc, but when I try to connect to it through any .ASP page I get the default instance! For example, if I use a database in the connection string that is also in the default instance, such as a system db, then the page works. If I try to connect with a DB in the connectin string that is only in the named instance, then I get the following error:

    Microsoft OLE DB Provider for SQL Server (0x80004005)
    Cannot open database requested in login 'LogHB'. Login fails.
    /MDF_Prod_Rprts/Test.asp, line 31


    Here's the connection string I'm using, which I know works, because I use it in all my pages:

    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''

    Dim cn

    'Create a connection object
    Set cn = Server.CreateObject("ADODB.Connection")

    'Connect using the OLE DB provider for SQL Server - SQLOLEDB
    cn.ConnectionString = "PROVIDER=SQLOLEDB" & _
    ";SERVER=*******" & _
    ";UID=******" & _
    ";PWD=*******" & _
    ";Trusted_Connection=True" & _
    ";DATABASE=LogHB"
    cn.ConnectionTimeout = 120
    cn.Open

    Set rs = Server.CreateObject("ADODB.Recordset")

    ' Associate the Recordset with the open connection
    rs.ActiveConnection = cn

    ' Associate the Recordset with the open connection
    rs.ActiveConnection = cn

    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''

    Why won't the .ASP page recognize the named instance...???

    Thanks in advance for any help
    Last edited by AJP; 01-24-2007 at 10:06 AM.

Posting Permissions

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