简体   繁体   中英

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. We are using ODBC connections for the data communications. The application randomly getting frozen or crashes giving different errors as attached below which very likely seems to be issues related to ODBC connection. Problems can be recreated by running different queries in quick successions.

SQL Server Version: SQL Express 14.0.3356.20

Access Version: Microsoft 365 Apps for Business Version 2011 (Build 13426.20204)

Most common error codes: 10054, 10060, 3146, 3151

ODBC Data Source Type: System DSN

ODBC Driver: ODBC Driver 17 for SQL Server (Version 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

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)

Error1 Error2 Error3

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)

  • Added TCP Port 1433 - TCP/IP protocol

  • Enabled Namepipe

  • Updated SQL Server Express from 14.0.3335.7 to 14.0.3356.20

  • Made IP4 and IP6 are both enabled

  • Enabled and checked ODBC Trace Logs

  • Checked Windows Event Logs

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.

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)
  • Enabled UDP Port 1434
  • Changed virtual port from blank to zero

2017 was still crashing before taking offline with the same settings. No issues with the 2019 version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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