VBA/Excel/Access/Word/Access/Database Replica — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 16:33, 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