简体   繁体   English

通过SQLDMO连接SQL Server

[英]Connecting SQL server through SQLDMO

I was able to connect to remote SQL server through SQLDMO residing my hosting server. 我能够通过驻留在托管服务器上的SQLDMO连接到远程SQL 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. 现在,当我刚刚切换到新的托管服务提供商时,我可以通过SQL Server Management Studio连接到数据库服务器,但是SQLDMO无法连接。

Here is my VB.NET code: 这是我的VB.NET代码:

    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())." “ [Microsoft] [ODBC SQL Server驱动程序] [DBNETLIB]无效的连接。[Microsoft] [ODBC SQL Server驱动程序] [DBNETLIB] ConnectionOpen(无效的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. 如果使用本地主机,请尝试使用服务器的IP地址。 If you have SQL server with the Instance then use instance name with the server Ip in your connection string. 如果您具有带实例的SQL Server,则将实例名称与连接字符串中的服务器Ip一起使用。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM