Hello folks,
Is there some way I can run some code in the background (possibly with a hidden form or otherwise) that can monitor and capture when an unanticipated drop table event might take place? In this case, what is happening is a local Jet table in an application is mysteriously being deleted.
I have an A2003 mde deployed on various PCs running A2003, A2007, and A2010. The application is only run on local PCs and manipulates data via pass-through queries on a server database (Oracle via ODBC). However, there are some local jet tables. One of these, tbl_Local_Prefs , is a single record with two fields for the user's name and is practically never updated. It has a single record with the name of the user. On some A2007 on 64 bit Win 7 pro machines, it is somehow being deleted from time to time.
The application is run multiple times every week day and this mysterious deletion occurs as much as once per week, sometimes more often than that, on the same two machines. Both machines run only A2007.
There is no code in the application to drop the table, and no table definition code whatsoever. I do have code run on start up that tries to get rid of those awful log message tables (in my case, my user name is Admin, so it's Admin - 001, 002, etc). It is as follows:
I don't think this affects the table, tbl_Local_Prefs , in question.
Any suggestions on how to capture when tbl_Local_Prefs might be dropped would be greatly appreciated.
Thank you very much in advance,
--
Tim
Is there some way I can run some code in the background (possibly with a hidden form or otherwise) that can monitor and capture when an unanticipated drop table event might take place? In this case, what is happening is a local Jet table in an application is mysteriously being deleted.
I have an A2003 mde deployed on various PCs running A2003, A2007, and A2010. The application is only run on local PCs and manipulates data via pass-through queries on a server database (Oracle via ODBC). However, there are some local jet tables. One of these, tbl_Local_Prefs , is a single record with two fields for the user's name and is practically never updated. It has a single record with the name of the user. On some A2007 on 64 bit Win 7 pro machines, it is somehow being deleted from time to time.
The application is run multiple times every week day and this mysterious deletion occurs as much as once per week, sometimes more often than that, on the same two machines. Both machines run only A2007.
There is no code in the application to drop the table, and no table definition code whatsoever. I do have code run on start up that tries to get rid of those awful log message tables (in my case, my user name is Admin, so it's Admin - 001, 002, etc). It is as follows:
Code:
Public Sub sAdminOracleTablesRemove()
'Goes through tabledefs abd deletes Admin tables if they can be deleted.
'Log Messages are already all no, so that approach to suppress the creation
'of these tables does not seem to work with Oracle PTQs
'
'DBLocal is a David Fenton proc that leaves a persistent database object throughout the session.
Dim tb As DAO.TableDef
On Error GoTo Err_Proc
dbLocal.TableDefs.Refresh
For Each tb In dbLocal.TableDefs
If Left(tb.Name, 7) = "Admin -" Then
Debug.Print tb.Name
DoCmd.Close acTable, tb.Name, acSaveNo
DoCmd.DeleteObject acTable, tb.Name
End If
Next tb
Exit_Proc:
Exit Sub
Err_Proc:
Select Case Err.Number
Case 3211 'in use by another person - These tables are sometimes locked.
Resume Next
Case 2450 'frmv not available - when closing
Resume Exit_Proc
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description, vbCritical, "sAdminOracleTablesRemove", Err.HelpFile, Err.HelpContext
Resume Exit_Proc
End Select
End Sub
Any suggestions on how to capture when tbl_Local_Prefs might be dropped would be greatly appreciated.
Thank you very much in advance,
--
Tim
Comment