Hi
My access database tests a version number in the backend against the number in the front end and if their is an update, I want to launch an access database installer and close the main database.
The code I have found in text books and on microsoft websites is not working.
An runtime error number 0 is always raised when trying to instantiate or open the database.
ie the GetObject method and the "New" instance of the class dont work. See these
Can anyone help?
Thanks
pb
Zollo A+ / VBA Developer
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)
My access database tests a version number in the backend against the number in the front end and if their is an update, I want to launch an access database installer and close the main database.
The code I have found in text books and on microsoft websites is not working.
An runtime error number 0 is always raised when trying to instantiate or open the database.
ie the GetObject method and the "New" instance of the class dont work. See these
Code:
Private Sub Form_Timer()
On Error GoTo ErrorHandler
'Stop
With Me
.TimerInterval = 0
!lblMessageToUser.Caption = "Checking for updates."
!lblMessageToUser.Visible = True
!cmdExit.SetFocus
!cmdOpenRegister.Enabled = False
!cmdAdmin.Enabled = False
!cmdReports.Enabled = False
.Repaint
End With
'Test code here is removed
'If test indicates an update is avail, run this code...
Dim strInstaller As String
strInstaller = "S:\xxx\DbInstaller\Installer.mdb"
Dim objAccess As Access.Application
[b]
Set objAccess = GetObject(strInstaller)
[/b]
'or
[b]
Set objAccess = GetObject(strInstaller, "Access.Application")
[/b]
'or
[b]
Set objAccess = New Access.Application
objAccess.OpenCurrentDatabase filepath:=strInstaller
[/b]
objAccess.Visible = True
Application.Quit acSaveYes
'Error handling code removed
Can anyone help?
Thanks
pb
Zollo A+ / VBA Developer
![[thumbsup] [thumbsup] [thumbsup]](/data/assets/smilies/thumbsup.gif)