Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping for an ODBC Connection Error to Access MDB
Message
From
04/08/2007 23:41:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Trapping for an ODBC Connection Error to Access MDB
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01245993
Message ID:
01245993
Views:
65
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?
Next
Reply
Map
View

Click here to load this message in the networking platform