Connection Problem

Discussion in 'ASP General' started by Istari, Oct 8, 2004.

  1. Istari

    Istari Guest

    Hi all

    I've made a local copy of a client website (Pages and DB). I'm running XP
    Pro and SQL 2000

    They make use of global.asa to establish the connection and the details on
    the live site were as follows:

    <SCRIPT LANGUAGE="VBScript" RUNAT="Server">



    Sub Application_OnStart

    Application("connStr") = "Provider=sqloledb;" & _
    "Data Source=SERVERIP" & _
    "Initial Catalog=databasename;" & _
    "User Id=username;" & _
    "Password=password"
    End Sub
    </SCRIPT>

    I put my local DB Server in Data Source and my local copy can be accessed
    using a DSN. However, when trying to run the website I get the following
    error:

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80004005)
    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
    denied.
    /churchillmurray.co.za/include/commonFunctions.asp, line 25

    That line of code where the error occurs looks as follows:
    objConn.Open Application("connStr")

    The site is in a virtual directory in IIS

    Can anyone help me in making the connection?
     
    Istari, Oct 8, 2004
    #1
    1. Advertising

  2. > "Data Source=SERVERIP" & _
    > "Initial Catalog=databasename;" & _


    Uh, did you mean to have a semi-colon after SERVERIP ?
     
    Aaron [SQL Server MVP], Oct 8, 2004
    #2
    1. Advertising

  3. Istari

    Istari Guest

    Hi, My mistake. That was a typo when I was typing the post. The actual info
    doesn't have the semi colon

    "Aaron [SQL Server MVP]" wrote:

    > > "Data Source=SERVERIP" & _
    > > "Initial Catalog=databasename;" & _

    >
    > Uh, dide you mean to have a semi-colon after SERVERIP ?
    >
    >
    >
     
    Istari, Oct 8, 2004
    #3
  4. > Hi, My mistake. That was a typo when I was typing the post. The actual
    info
    > doesn't have the semi colon


    That's my point, it needs one. If you print the string out, you'll see why:

    ....Data Source=SERVERIPInitial Catalog=databasename;...

    I'm guessing you don't have a server called "SERVERIPInitial
    Catalog=databasename" ...

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Oct 8, 2004
    #4
  5. Well it should. All the attributes in the connection string should be
    separated by simicolons.

    Istari wrote:
    > Hi, My mistake. That was a typo when I was typing the post. The
    > actual info doesn't have the semi colon3
    >
    > "Aaron [SQL Server MVP]" wrote:
    >
    >>> "Data Source=SERVERIP" & _
    >>> "Initial Catalog=databasename;" & _

    >>
    >> Uh, dide you mean to have a semi-colon after SERVERIP ?


    --
    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], Oct 8, 2004
    #5
    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. Mythran
    Replies:
    5
    Views:
    5,006
    Mythran
    Oct 5, 2005
  2. Dave Johnson

    Using Connection Class VS Connection Module

    Dave Johnson, Dec 9, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    660
    Dave Johnson
    Dec 11, 2005
  3. Linus Nikander
    Replies:
    5
    Views:
    566
  4. Replies:
    3
    Views:
    40,683
    Roedy Green
    Nov 16, 2005
  5. R
    Replies:
    1
    Views:
    594
Loading...

Share This Page