I am trying to track down an Error 3050 that occurs every week or so in a VB6 DAO network application which has 2 data entry operators using the same database. The database was made by splitting a database originally made using Access97. I want to see if there are any clues in the Windows Event Log (Windows 7). It seems to get entries from hundreds of sources but it uses Event numbers not Error numbers so searching for 3050 in the Event Viewer doesn't seem to work.

I also can't trap the error in my VB6 code using "On Error GoTo" so my app crashes when it happens.

I have one specific question. Should my application call DAO OpenDataBase only once at the start and save the db in a global variable or open it every time I want to read or write some records and then set db, rs, qdf, etc. to Nothing at the end of each subroutine. Now I do this:

Public Sub GetThisJobInfo(lngThisJobID As Long)
On Error GoTo GetThisJobInfo_Err

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = OpenDatabase(gstrMdbPath)
Set rs = db.OpenRecordset("Jobs", dbOpenDynaset)

rs.FindFirst "id = " & CStr(lngThisJobID)
If rs.NoMatch Then
glngThisJobID = 0 ' indicates NoMatch
With rs
glngThisJobID = Nz(!id, 0)
gdatThisJobDateCreated = Nz(!DateCreated, 0) ...

' getting all the info I care about into global variables and putting them on a form. Then when I have what I want I do this:

End With
End If

Set rs = Nothing
Set db = Nothing
Exit Sub

MsgBox "GetThisJobInfo_Err: " & Err.Number & vbCrLf & Err.Description
Set rs = Nothing
Set db = Nothing
Exit Sub

End Sub

Should I instead make db a global and do
Set db = OpenDatabase(gstrMdbPath)
at the start of my application and
Set db = Nothing
when the application exits?

Any ideas how to find the Error 3050 problem?