SQL Server 2008 OLE DB 从外部连接失败
我在云计算机上的 Windows 2008 服务器上安装了可用的 SQL Server 2008 R2 Express。来自多个客户端应用程序的所有类型的连接(ado.net、nhibernate 等)都可以正常工作,除了 OLEDB 连接。 SQL Native Client 也可以正常工作。
当我尝试从本地服务器连接并作为数据源写入实例名称时,一切正常。但从外部,我遇到了问题,或者如果我写 wan ip 或 dns,我也从本地遇到了问题。
-- works perfect from everywhere
Provider=SQLNCLI10;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- does not work from anywhere
Provider=SQLOLEDB.1;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- works only from local
Provider=SQLOLEDB.1;Data Source=flz001\sqlexpress;User ID=xxx;Password=xxx;
错误:[DBNETLIB][ConnectionOpen(无效实例())。无效 连接。
-- works perfect with ado.net
Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx
一些其他客户端应用程序(不是我的)是使用 oledb 连接编写的,因此我需要它们将数据库与 oledb 提供程序连接。
有什么想法吗?
问候, 梅尔特
I have a working SQL Server 2008 R2 Express installed on a Windows 2008 server on a cloud machine. All type of connections (ado.net, nhibernate etc.) from several client applications works fine except the OLEDB one. SQL Native Client also works fine.
When I tried to connect from the server locally and as a data source write the instance name, everything was OK. But from outside, I had the problem or also if I write wan ip or dns I had the problem also from local.
-- works perfect from everywhere
Provider=SQLNCLI10;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- does not work from anywhere
Provider=SQLOLEDB.1;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- works only from local
Provider=SQLOLEDB.1;Data Source=flz001\sqlexpress;User ID=xxx;Password=xxx;
Error: [DBNETLIB][ConnectionOpen (Invalid Instance()).Invalid
connection.
-- works perfect with ado.net
Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx
Some other client applications (not mine) was written with oledb connection so I need them to connect the db with oledb provider.
Any ideas?
Regards,
Mert
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自从提出这个问题以来已经有一段时间了,但我目前正在解决一个与 OLE DB 和 SQL Server 相关的问题,听起来可能与之相关。
我发现,即使服务器使用默认端口 (1433),我仍然必须在 UDL 连接字符串中显式指定它,如下所示:
我已经问过为什么这里可能需要这样做:
为什么 SQL Server 2008 OLE 可能会DB UDL 需要显式指定端口 1433?
也许可以尝试一下,看看是否有帮助。
It has been a while since this was asked, but I am currently working through an issue related to OLE DB and SQL Server that sounds possibly related.
I found that, even though the server was using the default port (1433), I still had to explicitly specify it in the UDL connection string like this:
I've asked why that might be necessary here:
Why might SQL Server 2008 OLE DB UDL require port 1433 explicitly specified?
Maybe try that and see if it helps.