rubbernilly
Programmer
Hello all,
I am trying to roll changes to a production database by creating a procedure that a user can run in the Rollout DB to update the Live DB. I've got the table entry changes taken care of, and I've got the query updates taken care of. There is also one form that I need to get from the Rollout DB to the Live DB.
From some searching on the web, I found a suggestion to use automation to open the Live database, and using their (slightly modified) code, I am trying this:
My call to this procedure looks like this:
But this opens the database visibly on the computer (in the first line) and just sits there (it doesn't even perform the DeleteObject command). Clicking back over to the Rollout DB code window, you get the error that the DeleteObject command was canceled.
Any suggestions on fixing this procedure or on doing this another way?
I am trying to roll changes to a production database by creating a procedure that a user can run in the Rollout DB to update the Live DB. I've got the table entry changes taken care of, and I've got the query updates taken care of. There is also one form that I need to get from the Rollout DB to the Live DB.
From some searching on the web, I found a suggestion to use automation to open the Live database, and using their (slightly modified) code, I am trying this:
Code:
Public Sub AddRemoveRemoteObject( _
ByVal FileName As String, _
ByVal ObjectType As AcObjectType, _
ByVal ObjectName As String, _
bRemove As Boolean)
Dim a As Access.Application
Set a = New Access.Application
With a
Select Case Right(FileName, 4)
Case ".adp"
.OpenAccessProject FileName
Case ".mdb"
.OpenCurrentDatabase FileName
Case Else
MsgBox "Please, pass a valid file type!", , "Uh Oh"
.Quit
Exit Sub
End Select
If bRemove = True Then
.DoCmd.DeleteObject ObjectType, ObjectName
Else
.DoCmd.TransferDatabase acImport, "Microsoft Access", FileName, ObjectType, ObjectName
End If
.Quit
End With
End Sub
My call to this procedure looks like this:
Code:
AddRemoveRemoteObject sLiveDB, acForm, "MyForm", True
AddRemoveRemoteObject sLiveDB, acForm, "MyForm", False
But this opens the database visibly on the computer (in the first line) and just sits there (it doesn't even perform the DeleteObject command). Clicking back over to the Rollout DB code window, you get the error that the DeleteObject command was canceled.
Any suggestions on fixing this procedure or on doing this another way?