locked
Close Access Database Cleanly in the event of lost network connection. RRS feed

  • Question

  • Hello, how can code an access database to close cleanly in the event of a lost network connection.

    Currently dozens of messages appear before Access crashes, following the "Your network access was interrupted, to continue close the database and then open it again." error.

    Thank you

    Nath


    Nath

    Thursday, October 19, 2017 12:22 PM

Answers

  • Check out the July 2016 entries here: https://support.office.com/en-us/article/What-s-new-in-Access-2016-76454345-f85d-47af-ace1-98a456cb3496?ui=en-US&rs=en-US&ad=US


    -Tom. Microsoft Access MVP

    • Marked as answer by NaPazz Monday, October 30, 2017 1:03 PM
    Thursday, October 19, 2017 1:51 PM

All replies

  • Hi Nath,

    Have you tried adding an error handler in your code? If not, maybe an error handler can trap the problem, and you can tell Access to exit gracefully.

    Just my 2 cents...

    Thursday, October 19, 2017 1:34 PM
  • Check out the July 2016 entries here: https://support.office.com/en-us/article/What-s-new-in-Access-2016-76454345-f85d-47af-ace1-98a456cb3496?ui=en-US&rs=en-US&ad=US


    -Tom. Microsoft Access MVP

    • Marked as answer by NaPazz Monday, October 30, 2017 1:03 PM
    Thursday, October 19, 2017 1:51 PM
  • There is not a lot you can do.

    Access is NOT designed for networks or connections that are intermittent.

    What this means is it “difficult” or risky to say use a WiFi (wireless) connection.

    The solution is to determine why such network connections are being dropped.

    You don’t mention if this network connection is to an Access back end, or an ODBC (to say sql server).

    I am not aware of a means to “gracefully” handle such broken connections except to suggest that you do your best to ensure that such connections don’t break.

    So no, there not a gracefully means to handle loss of connections in Access – this includes both accDB (file base) back ends, and that of SQL server based and ODBC.

    The fix is to determine why the connection is being lost. In later versions of windows, say 8 or now 10, we often see network connections being dropped due to FAR MORE aggressive power management by windows (so disable the feature that lets windows power down the network card for example).

    Regards,

    Albert D. Kallal (Access MVP, 2003-2017)

    Edmonton, Alberta Canada

    Friday, October 20, 2017 10:16 PM
  • > there not a gracefully means to handle loss of connections in Access – this includes both accDB (file base) back ends, and that of SQL server based and ODBC.

    That is no longer completely true Albert - see the link I posted in first instance.


    -Tom. Microsoft Access MVP

    Saturday, October 21, 2017 7:59 PM
  • In addition to all said, consider wrapping your data-changing queries in Transactions.


    peter n roth - http://PNR1.com, Maybe some useful stuff

    Sunday, October 22, 2017 9:56 PM