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())."

有帮助吗?

解决方案

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/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top