简体   繁体   English

将MS Access 2007连接到SQL Server 2008(不使用端口1433的命名实例)

[英]Connecting MS Access 2007 to SQL Server 2008 (a named instance not using port 1433)

I have to setup my connection string correctly to link MS Access 2007 tables to a SQL Server 2008 backend named instance using a DSN-Less connection 我必须正确设置我的连接字符串,才能使用DSN-Less连接将MS Access 2007表链接到SQL Server 2008后端命名实例

The sql server instance is not using port 1433, so I need to specify the port number in the connection string (port 4142) sql server实例未使用端口1433,因此我需要在连接字符串(端口4142)中指定端口号

ConnectStr = "ODBC;DRIVER={SQL Server Native Client 10.0}" _
& ";SERVER=ServerName\InstanceName,PortNo." _
& ";DATABASE=database" _
& ";Trusted_Connection=yes;"

This did not work and I got an ODBC Error No. 3151. 这不起作用,我收到了3151号ODBC错误。

Am I able to specify the port number this way Or do I have to use another driver if I have to specify the port number the sql server is listening on. 我可以通过这种方式指定端口号吗?如果必须指定sql服务器正在侦听的端口号,是否必须使用其他驱动程序。

Thanks 谢谢

Geoff 杰夫

Apparently there is no need specify the instance name if you're giving the port number. 显然,如果您要提供端口号,则无需指定实例名称。 Could be worth a shot. 可能值得一试。

ConnectStr = "ODBC;DRIVER={SQL Server Native Client 10.0}" _
& ";SERVER=ServerName,PortNo." _
& ";DATABASE=database" _
& ";Trusted_Connection=yes;"

Refer to this question for more info. 有关更多信息,请参阅此问题

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

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