简体   繁体   English

MS Access 前端到 SQL 服务器间歇性 ODBC 连接问题

[英]MS Access front end to SQL Server intermittant ODBC connection issues

We have a MS-Access front application using data from a SQL server back-end.我们有一个 MS-Access 前端应用程序,它使用来自 SQL 服务器后端的数据。 We are using ODBC connections for the data communications.我们使用 ODBC 连接进行数据通信。 The application randomly getting frozen or crashes giving different errors as attached below which very likely seems to be issues related to ODBC connection.应用程序随机冻结或崩溃,给出不同的错误,如下所示,这很可能是与 ODBC 连接相关的问题。 Problems can be recreated by running different queries in quick successions.可以通过快速连续运行不同的查询来重新创建问题。

SQL Server Version: SQL Express 14.0.3356.20 SQL 服务器版本: SQL Express 14.0.3356.20

Access Version: Microsoft 365 Apps for Business Version 2011 (Build 13426.20204)访问版本: Microsoft 365 商业应用版 2011(内部版本 13426.20204)

Most common error codes: 10054, 10060, 3146, 3151最常见的错误代码: 10054、10060、3146、3151

ODBC Data Source Type: System DSN ODBC 数据源类型:系统DSN

ODBC Driver: ODBC Driver 17 for SQL Server (Version 2017.176.01.01) ODBC 驱动程序: SQL 服务器的 ODBC 驱动程序 17(版本 2017.176.01.01)

Example Connection String for a linked table: ODBC;Description=Test Description;DRIVER=ODBC Driver 17 for SQL Server;SERVER=MY-SERVER;UID=MyUser;Trusted_Connection=No;APP=Microsoft Office;DATABASE=TestDatabase;;TABLE=dbo.TableName链接表的示例连接字符串: ODBC;Description=Test Description;DRIVER=ODBC Driver 17 for SQL Server;SERVER=MY-SERVER;UID=MyUser;Trusted__=No;APP=Microsoft Office;DATABASE=TestDatabase;;TABLE dbo.TableName

Largest Table Size: 53000 records (Doesn't really matter, fails for even smaller queries, but if you try faster getting results from different queries you can break it)最大表大小: 53000 条记录(没关系,即使是更小的查询也会失败,但如果你尝试更快地从不同查询中获取结果,你可以打破它)

Error1 Error2 Error3错误1错误2 错误 3

We have gone through hundres of searches/articles about these and applied the fixes listed below, but still couldn't get the problem solved.我们已经浏览了数百次关于这些的搜索/文章并应用了下面列出的修复程序,但仍然无法解决问题。

We have tried below solutions as of now which didn't help.到目前为止,我们已经尝试了以下解决方案,但没有帮助。

  • Created firewall rules (Inbound - TCP Port 1433, Outbound - TCP all ports)创建防火墙规则(入站 - TCP 端口 1433,出站 - TCP 所有端口)

  • Added TCP Port 1433 - TCP/IP protocol添加了 TCP 端口 1433 - TCP/IP 协议

  • Enabled Namepipe启用命名管道

  • Updated SQL Server Express from 14.0.3335.7 to 14.0.3356.20将 SQL Server Express 从 14.0.3335.7 更新到 14.0.3356.20

  • Made IP4 and IP6 are both enabled已启用 IP4 和 IP6

  • Enabled and checked ODBC Trace Logs启用并检查 ODBC 跟踪日志

  • Checked Windows Event Logs检查 Windows 事件日志

Hope I have included everything that might be useful to get some help resolving this issue.希望我已经包含了所有可能有助于解决此问题的帮助。

Note: Not sure if it's related, but the SQL Server itself (in the backend) giving the below error in rare occasions if it helps.注意:不确定它是否相关,但 SQL 服务器本身(在后端)如果有帮助,在极少数情况下会出现以下错误。

Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=29278; handshake=26244;  (.Net SqlClient Data Provider)

Thanks everyone who tried to help.感谢所有试图提供帮助的人。 This issue has now been fixed.此问题现已修复。 For anyone who will come here in future looking for a solution for a similar issue, below is what worked for us.对于将来会来这里寻找类似问题的解决方案的任何人,以下是对我们有用的方法。

  • Added a new instance of SQL Server 2019 (in the same virtual machine which 2017 sits on)添加了 SQL Server 2019 的新实例(在 2017 所在的同一虚拟机中)
  • Enabled UDP Port 1434启用 UDP 端口 1434
  • Changed virtual port from blank to zero将虚拟端口从空白更改为零

2017 was still crashing before taking offline with the same settings. 2017 在使用相同的设置下线之前仍然崩溃。 No issues with the 2019 version. 2019版没有问题。

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

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