SQL Server 客户端别名不起作用
旧版 vb6 应用程序使用硬编码连接字符串,例如“
Provider=SQLOLEDB.1;User ID=USER_NAME;password=USER_PASSWORD;Initial Catalog=DB_NAME;Data Source=OLD_SERVER_NAME;Network Library=DBMSSOCN
目标是将此应用程序转发到具有特定端口的 NEW_SERVER_NAME
”。 我已经创建了别名,但它不起作用,应用程序继续使用旧服务器。
但是,如果删除部分 Network Library=DBMSSOCN
(我在测试应用程序中做到了) 一切正常。
有没有机会让它与原始连接字符串一起工作?
The legacy vb6 application uses hardcoded connection strings like
Provider=SQLOLEDB.1;User ID=USER_NAME;password=USER_PASSWORD;Initial Catalog=DB_NAME;Data Source=OLD_SERVER_NAME;Network Library=DBMSSOCN
The goal is to forward this application to the NEW_SERVER_NAME
with specific port.
I've created alias but it is not working, application continues to use old server.
However if remove part Network Library=DBMSSOCN
(I did it in test application)
everything works fine.
Is there any chance to make it work with original connection string?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
DBMSSOCN
指用于连接的网络库。在本例中为 TCP/IP。可以为命名管道、TCP/IP 和 VIA 配置别名。当您删除DBMSSOCN
设置时,它会回退到命名管道而不是 TCP/IP。确保两件事(均在 SQL Server 配置管理器中的 32 位和 64 位 SQL Native Client 配置部分):您可能需要在应用程序服务器上安装 SQL Native Client 10.0 并更改连接字符串才能使用它在此之前的客户端版本将起作用。要安装新客户端,您需要安装SQL Server Tools 来自 SQL Server 2008 安装。新的连接字符串可能如下所示(示例是来自 ConnectionStrings.com):
DBMSSOCN
refers to the network library used for the connection. In this case, TCP/IP. Aliases can be configured for Named Pipes, TCP/IP, and VIA. When you remove theDBMSSOCN
setting, it falls back to Named Pipes instead of TCP/IP. Make sure of two things (both in SQL Server Configuration Manager under the 32-bit and 64-bit SQL Native Client Configuration sections):You may need to install the SQL Native Client 10.0 on the application server and change the connection string to use that version of the client before this will work. To install the new client, you'll need to install the SQL Server Tools from the installation of SQL Server 2008. The new connection string may look like the following (example is standard security from ConnectionStrings.com):
cliconfg.exe 可用于在 64b 计算机上运行时配置客户端别名,仅为 64b 程序创建条目;如果您没有 sql 工具并且想要为 32 和 64b 程序创建别名,请在注册表中创建以下条目(下面是带有 TCP 别名的 reg 文件的内容):
cliconfg.exe which can be used to configure client alias when run on 64b machine only creates entry for 64b programs; if you don't have sql tools and want to create alias for both 32 and 64b programs create following entries in registry (below are contents of reg file with TCP alias):
默认 TCP/IP 端口是 1433,但这是可配置的。这是一个逐步的步骤(希望)至少可以解决您所面临的问题的一部分。
http://msdn.microsoft.com/en-us/library/ms177440.aspx
至于您的别名,您可以确保您是在客户端而不是 sql-server 上创建的。 (并不是说你做错了什么,但我有时会看到这个错误......)
http://support.microsoft.com/kb/289573
The default TCP/IP port is 1433, but that's configurable. Here's a step-by-step that (hopefully) addresses at least that part of the problem you're facing.
http://msdn.microsoft.com/en-us/library/ms177440.aspx
As for your alias, you might make sure that you created it on the client, not sql-server. (Not saying you did anything wrong, but I see that mistake sometimes...)
http://support.microsoft.com/kb/289573