Reputation: 1405
I have installed an instance of MS SQL server Express on a new server. I have a web application with some old ASP.NET code written in VBScript, using another database (SQL Server) which works fine.
every attempt to connect gives the same error:
Microsoft OLE DB Provider for SQL Server error '80004005' [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
The code is:
Set udb = Server.CreateObject("ADODB.Connection")
'SQLEXPRESS ENVIRONMENT
udb.Open("Provider=SQLOLEDB; Data Source=SEHAN5134AS1\SQLEXPRESS,1433; Initial Catalog=testDB; User ID=myUser; Password=sEcret;")
'PRODUCTION ENVIRONMENT
'udb.Open("Provider=SQLOLEDB; Data Source=manifolds-avalon.db.teliasonera.net,1433; Initial Catalog=smallworldweb_user-data; User ID=myUser; Password=sEcret;")
I have made an ODBC connection to verify that the the web server is able to connect to the server with the SQL-server and it works fine. I have tried to give the myUser any kinds of rights on the database. I can connect to the database with other programs (tcpip and named pipes are allowed, remote connections are etc.)
I have tried to add
"Server=SEHAN5134AS1.db.teliasonera.net; Network=DBMSSOCN;"
to the connection string. I have tried to use the full server name in the "Data Source" string. But now I have no ideas how to solve the problem. Any suggestions?
EDIT I have tried to make the connection via powershell as proposed by Dan Guzman and the result is shown below with the result of setting the ODBC connection. All results are from the same web server.
Upvotes: 2
Views: 2453
Reputation: 619
I struggled with the same issue. And for me the solution was to "have TCP/IP enabled in SQL server network config" and remember also to restart the service for it to take effect!
Upvotes: 2
Reputation: 1405
This answer is just to close the question. I never got the connection up working and installed a SQLSERVER Express on the webserver instead.
Upvotes: 0
Reputation:
goto MS SQL server config and enable sql server browser by changing start mode from disabled to automatic then start the service. you should be able to connect after. make sure your ports are open 1433 TCP and 1434 UDP on your MS SQL server not IIS. Also make sure you have TCP/IP enabled in SQL server network config
Upvotes: 1
Reputation: 423
Try this code
udb.Open("Provider=SQLOLEDB; Data Source=SEHAN5134AS1\SQLEXPRESS; Initial Catalog=testDB; User ID=myUser; Password=sEcret;")
Upvotes: 2