VBA/Excel/Access/Word/Access/Database Replica — различия между версиями
| Admin (обсуждение | вклад)  м (1 версия) | |
| (нет различий) | |
Текущая версия на 12:46, 26 мая 2010
Creating a Design Master
 
Sub Create_DesignMaster(dbName As String, strPath As String) 
    Dim repDesignMaster As New JRO.Replica 
    Dim myFileSystemObject As Scripting.FileSystemObject 
    Dim strDb As String 
    Set myFileSystemObject = New FileSystemObject 
    strDb = strPath & "DM_" & dbName 
    If Not myFileSystemObject.FileExists(strDb) Then 
        myFileSystemObject.CopyFile strPath & dbName, strDb 
    Else 
        Debug.Print "The " & strDb & " database file already exists." 
        Exit Sub 
    End If 
    repDesignMaster.MakeReplicable strDb, True 
    Set repDesignMaster = Nothing 
    Set myFileSystemObject = Nothing 
End Sub
   
Creating a Full Replica
 
Sub Make_FullReplica(DesignMasterName As String, _ 
             NewRepName As String) 
    Dim repDesignMaster As New JRO.Replica 
    With repDesignMaster 
        .ActiveConnection = DesignMasterName 
        .CreateReplica CurrentProject.Path & "\" & NewRepName, _ 
            "Replica of " & DesignMasterName 
    End With 
End Sub