How to write connection string to connect from classic ASP page to SQL 2008 R2?

14,367

The (local) name you've given for your data source is invalid. It should be an IP address, server name or server/instance name of your SQL installation.

UPDATE

If the SQL server is on the webserver you can use . to specify local. Here's an example connection string from one of my classic ASP projects:

"Provider=SQLNCLI10;Server=.;Database=my_db;Uid=user;Pwd=pass;"

Share:
14,367
theateist
Author by

theateist

Updated on June 04, 2022

Comments

  • theateist
    theateist almost 2 years

    I connect from classic ASP page to SQL SERVER 2008 R2 with following connection string

    "Data Source=(local);Initial Catalog=my_db;Persist Security Info=True;User ID=my_user;Password=my_pass;"

    but I get error

    Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    I verified that my_db exists!, so what is wrong in my connection string?