I have had a problem with my secured, split database losing its connection to JRO, so I have found some code which checks if the JRO connection is there on startup and if it isnt it adds JRO. this work great for me, as a database administrator, but doesnt run when i log on as a user.
the point of adding the code to the system was so i wouldnt have to go to every computer and re-connect JRO.
can anyone help with getting the code to run as a User?
code is:
Private Sub Form_Load()
Dim ref As Reference
Dim refName As String
Dim refFound As Boolean
refFound = False
refName = "JRO"
For Each ref In Application.References
If ref.Name = refName Then
refFound = True
End If
If ref.Name = refName And ref.IsBroken = True Then
References.Remove References!refName
References.AddFromFile "C:\program files\common files\system\ado\msjro.dll"
MsgBox "A problem has been detected." & vbNewLine & _
"The problem has been resolved but the database will now close." & vbNewLine & _
"Double click on ICMIS to restart the databaes", vbExclamation
DoCmd.Quit
End If
Next
If refFound = False Then
References.AddFromFile "C:\program files\common files\system\ado\msjro.dll"
MsgBox "A problem has been detected." & vbNewLine & _
"The problem has been resolved but the database will now close." & vbNewLine & _
"Double click on ICMIS to restart the databaes", vbExclamation
DoCmd.Quit
End If
End Sub
thanks
the point of adding the code to the system was so i wouldnt have to go to every computer and re-connect JRO.
can anyone help with getting the code to run as a User?
code is:
Private Sub Form_Load()
Dim ref As Reference
Dim refName As String
Dim refFound As Boolean
refFound = False
refName = "JRO"
For Each ref In Application.References
If ref.Name = refName Then
refFound = True
End If
If ref.Name = refName And ref.IsBroken = True Then
References.Remove References!refName
References.AddFromFile "C:\program files\common files\system\ado\msjro.dll"
MsgBox "A problem has been detected." & vbNewLine & _
"The problem has been resolved but the database will now close." & vbNewLine & _
"Double click on ICMIS to restart the databaes", vbExclamation
DoCmd.Quit
End If
Next
If refFound = False Then
References.AddFromFile "C:\program files\common files\system\ado\msjro.dll"
MsgBox "A problem has been detected." & vbNewLine & _
"The problem has been resolved but the database will now close." & vbNewLine & _
"Double click on ICMIS to restart the databaes", vbExclamation
DoCmd.Quit
End If
End Sub
thanks