Connection string

  • I am having issues with a connection string. At the moment we have a web page requesting data from a SQL server 2005 database. The database is now being moved to SQL Server 2014 on a new server.
    The connection has been altered to point to the new database, but the following error appears.
    Microsoft OLE DB Provider for SQL Server error '80004005'
    Cannot open database "xxxxxxxxx" requested by the login. The login failed.

    The connection string being used is
    "PROVIDER=SQLOLEDB;DATA SOURCE=my server nameUID=my user;PWD=my passowrd;DATABASE=Database name"
    Any help would be much appreciated.

  • clucasi - Tuesday, February 14, 2017 7:57 AM

    I am having issues with a connection string. At the moment we have a web page requesting data from a SQL server 2005 database. The database is now being moved to SQL Server 2014 on a new server.
    The connection has been altered to point to the new database, but the following error appears.
    Microsoft OLE DB Provider for SQL Server error '80004005'
    Cannot open database "xxxxxxxxx" requested by the login. The login failed.

    The connection string being used is
    "PROVIDER=SQLOLEDB;DATA SOURCE=my server nameUID=my user;PWD=my passowrd;DATABASE=Database name"
    Any help would be much appreciated.

    Most of the time, that provider is named SQLOLEDB.1,and you also appear to be missing a semi-colon after server name, so perhaps you can try:

    "PROVIDER=SQLOLEDB.1;DATA SOURCE=my server name;UID=my user;PWD=my passowrd;DATABASE=Database name"

    Alternatively, can you use SQL Native Client?   Then you could use the appropriate value for it, as follows:

    Assuming SQL 2014:

    "PROVIDER=SQLNCLI11;Server=my server name;UID=my user;PWD=my passowrd;InitialCatalog=Database name"

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • It should be ...Data Source=________;Initial Catalog=__________;User Id=_______;Password=______;

    Dave,
    IT Jobs
    KSL classifieds
    Clasificados Los angeles
    Busco Trabajo

  • The error means that the login "my user" does not have access to the database named "Database name", check your DB security.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply