Question

I was able to connect to remote SQL server through SQLDMO residing my hosting server. There was no issue. Now as I've Just switched to the new hosting provider, I can connect to the database server through SQL server management studio but SQLDMO I cannot connect anymore.

Here is my VB.NET code:

    Dim oServer as New SQLDMO.SQLServer2
    oServer.EnableBcp = True
    oServer.Connect(pServer, pUserName, pPassword)

At third line an error pops up saying:

"[Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection. [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance())."

Was it helpful?

Solution

You will need to check if you are using correct Data Source name in your connection string. If you are using localhost then try to use IP address of server. If you have SQL server with the Instance then use instance name with the server Ip in your connection string.

http://forums.esds.co.in/f4/dbnetlib-connectionopen-invalid-instance-invalid-connection-4139/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top