I have an Access application that is running on the computers of numerous individuals at one of my clients, running various different versions of Windows and Office. We have migrated a number of tables to SQL Server but the connection strings for the different computer configurations are different, so I have a function which attempts to open a pass-thru query that selects the first record from one of the tables on the SQL server. If that process raises an error, the error handler attempts several other connection strings until it finds the proper one for the current users computer; that part works fine.
However, some of the users of the application do so over a VPN, with the application on their home or laptop and if they have failed to open the VPN connection prior to running the application, the receive the following error message:
SQL Server Error: 53
[Microsoft][ODBC SQL Server Driver][DBNETLIB][ConnectionOpen(Connect()).
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
exist or access is denied.
which is not intercepted by the Access error handler. How can I intercept that error and handle it cleanly within my application? Or is their some easy to test whether the VPN connection is open?