I have the following VBScript, which is supposed to connect to a SQL Server 2005 database. But, my connection is failing. Why?
Set dbConnection = CreateObject("ADODB.Connection")
dbConnString = "Provider=SQLOLEDB.1;Data Source=srv\test1;" & _
"Initial Catalog=tset_DB;user id ='abc';password='abc'"
'Open the connection
dbConnection.Open dbConnString
Best Answer
You don't need quotations around your username and password. Try this:
Also, your
Initial Catalog
was set totset_DB
, when I'm guessing it should betest_DB
.ConnectionStrings.com is a huge help for ensuring that your connection strings are valid.