JoanneJames
Registered User.
- Local time
- Today, 08:24
- Joined
- Feb 19, 2008
- Messages
- 59
Microsoft database engine could not find the object ""...." when running mde
I was having a strange issue - and was writing up this message, when I figured out the problem. just wanted to share in case anyone else has a similiar one:
I am using timers to close all forms except the login screen, after a 2-minute interval. On KeyDown and MouseDown, I set a public variable (in a module) to indicate it is OK to stay open. The Timer event checks this variable - and resets it to false every 2 minutes. If someone does not use the keyboard or mouse it will stay false and next time code is executed it will call a function to close all forms. My problem is that while it works in the mdb version, I am getting an error when running the mde version.
I was getting error: 3011 error msg " The Microsoft database engine could not find the object ""...." when running mde, but NOT mdb. Turns out that logic in a form_unload was preventing one of the forms from closing. When I removed this, so this form would close, no longer got the error in the mde file. Here was the original code:
Private Sub Form_Unload(Cancel As Integer)
Cancel = Not OKToClose 'cancel would always be true for mde files, so removed
'When unloading the scan form, reset login caption & allow user to see login screen
If Not Cancel Then 'commented out if/endif lines
UserAlreadyLoggedOn = False 'public var in module
Forms!frmLogin!cmdMainMenu.Caption = "SCAN Screen"
Forms!frmLogin.Visible = True
End If
End Sub
I was having a strange issue - and was writing up this message, when I figured out the problem. just wanted to share in case anyone else has a similiar one:
I am using timers to close all forms except the login screen, after a 2-minute interval. On KeyDown and MouseDown, I set a public variable (in a module) to indicate it is OK to stay open. The Timer event checks this variable - and resets it to false every 2 minutes. If someone does not use the keyboard or mouse it will stay false and next time code is executed it will call a function to close all forms. My problem is that while it works in the mdb version, I am getting an error when running the mde version.
I was getting error: 3011 error msg " The Microsoft database engine could not find the object ""...." when running mde, but NOT mdb. Turns out that logic in a form_unload was preventing one of the forms from closing. When I removed this, so this form would close, no longer got the error in the mde file. Here was the original code:
Private Sub Form_Unload(Cancel As Integer)
Cancel = Not OKToClose 'cancel would always be true for mde files, so removed
'When unloading the scan form, reset login caption & allow user to see login screen
If Not Cancel Then 'commented out if/endif lines
UserAlreadyLoggedOn = False 'public var in module
Forms!frmLogin!cmdMainMenu.Caption = "SCAN Screen"
Forms!frmLogin.Visible = True
End If
End Sub