Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Trapping for an ODBC Connection Error to Access MDB
Versions des environnements
I have a program that uses an ODBC connection to an Access database and updates some fields in one of the tables in the MDB.
This program has been running without incident for months, however, it crashed today with an error indicating that the database needs repairing. I tried repairing the database but it won't repair so there is something seriously wrong with the MDB. Another person's process updates this MDB daily, so it's really not my problem. However, I would like for my program to know how to handle this type of error. I have tried using the ON ERROR and TRY/CATCH/ENDTRY approaches but neither seem to work. The ON ERROR and the TRY/CATCH/ENDTRY neither catch the error. It appears that the error is coming from the ODBC driver. The error is happing when my program tries to open the view (with USE); I still get an errror message on the screen stating that the MDB needs to be repaired.
Does anyone know how I can catch this error so I can handle it programmatically?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement