I've been googling for a few days and have tried all kinds of connection strings, but none have worked so far. I have a webpage on one server (using ASP NOT ASP.NET) trying to connect to a SQL database on another server (SQL 2005 server). I tried connecting using .net on another page and I just added a SqlDataSource tool and that works so I know there isn't a block between the servers. I think it must be my connection string.
Here are some of the connection strings I've tried (they all have different error messages and error out at the conn.open):
set conn=Server.CreateObject("ADODB.Connection")
cst = "Driver={SQL Server};Server=111.111.11.11;Database=dbname;UID=domain\user;PWD=password"
conn.Open(cst)
------------------
conn.ConnectionString="driver={SQL Server};server=servername;uid=domain\user;pwd=password;"
conn.Open
conn.DefaultDatabase="dbname"
------------------
conn.Open "Provider=SQLNCLI;Server=111.111.11.11;Database=dbname;UID=domain\user;PWD=password;"
-----------------
conn.ConnectionString="Driver={SQL Server};Server=111.111.11.11;Initial Catalog=dbname;User Id=domain\user;Password=password;Trusted_Connection=True;"
conn.Open
---------------------
conn.Open "Provider=SQLOLEDB; Data Source = 111.111.11.11; Initial Catalog = dbname; User Id = domain\user; Password=password;"
----------
conn.Open "Provider=SQLOLEDB;Password=password;Persist Security Info=True;User ID=domain\user;Initial Catalog=dbname;Data Source=servername"
-----------------------
cst = "Provider=SQLOLEDB;" & _
"Data Source=111.111.11.11;" & _
"Initial Catalog=dbname;" & _
"Network=DBMSSOCN;" & _
"User Id=domain\user;" & _
"Password=password"
conn.open cst
The last connection string has this error:
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'domain\user'.
-------------
maybe it is a server setting, but I have looked on the SQL server management studio and that user is in the security list and I can log on to the server using that username and password. The ip on here is not real, but I made sure it is correct on the real page.
I would appreciate any kind of advice or suggestion. Thank you!