简体   繁体   English

MS Access连接到SQL Server Express

[英]MS Access to connect to SQL Server Express

Ok I have a strange problem that seems to make no logical sense. 好吧,我有一个奇怪的问题,似乎没有逻辑意义。

I have a SQL Server Express running on ComputerA. 我在ComputerA上运行了SQL Server Express。 On ComputerA , I have designed a MS Access database client to access this data. ComputerA ,我设计了一个MS Access数据库客户端来访问此数据。

I have transferred the MS Access file to ComputerB (on same network as ComputerA ) and I am able to type in the username and password and things connect and I am able to see the data. 我已转MS Access文件到ComputerB (为同一个网络上ComputerA )和我能够键入usernamepassword ,并事物联系在一起,我能够看到的数据。 Also, I am able to access my SQL Server Express via PHP on any computer. 另外,我可以在任何计算机上通过PHP访问我的SQL Server Express。 ( slsweb.ocmboces.org/loginpage/SQLTEST2.php ) slsweb.ocmboces.org/loginpage/SQLTEST2.php

On ComputerC and ComputerD , I have the same MS Access file. ComputerCComputerD ,我具有相同的MS Access文件。 When I click on my forms it asks me to connect to the server on ComputerA which is WIN-XXXXX . 当我单击表单时,它要求我连接到ComputerA上的服务器,该服务器为WIN-XXXXX I use the same username and password but it will not connect. 我使用相同的usernamepassword但无法连接。

I have tried to configure ODBC data sources but they will not connect to the server. 我尝试配置ODBC数据源,但它们将不会连接到服务器。 I also have opened almost everything on the firewall on the server computer which is ComputerA . 我还打开了服务器计算机ComputerA防火墙上的几乎所有内容。

What am I doing wrong? 我究竟做错了什么?

Problem: Unable to ping by name from client computers to database server. 问题:无法按名称从客户端计算机ping到数据库服务器。

Solution: Setup the ODBC connection using the IP address only. 解决方案:仅使用IP地址设置ODBC连接。 Do not need port number if default (1433) is being used. 如果使用默认值(1433),则不需要端口号。

You can also look into creating an LMHOSTS files. 您也可以研究创建LMHOSTS文件。

See KB article below from Microsoft on how to do this for windows 7. Basically the file translates the name of the server to an ip, poor mans DNS. 有关如何在Windows 7上执行此操作,请参阅下面Microsoft的KB文章。基本上,该文件将服务器的名称转换为ip,可怜的DNS。

http://support.microsoft.com/kb/101927 http://support.microsoft.com/kb/101927

Here is an article on inbound rules for dynamic SQL Server ports. 这是有关动态SQL Server端口的入站规则的文章。 Just google adding inbound/outbound firewall rules. 只是谷歌添加入站/出站防火墙规则。

http://technet.microsoft.com/en-us/library/ms175043.aspx http://technet.microsoft.com/zh-CN/library/ms175043.aspx

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

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