Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't Find Partial Replica (2003)

    I'm trying to create a partial replica from a full replica using the code below which I've put in a standard module being part of the full replica mdb.

    <pre> <font color=red>Public Sub adhCreatePartialReplicaExample( _
    strPartial As String)
    ' Creates a new partial replica from
    ' the current replica
    ' and populates the new partial replica.
    ' From Access 2000 Developer's Handbook, Volume II
    ' by Litwin, Getz, Gilbert. (Sybex)
    ' Copyright 1999. All Rights Reserved.

    Dim rplPartial As JRO.Replica
    Dim rplFull As JRO.Replica
    Dim strConnect As String
    Dim strCustOrderRel As String
    Dim strOrderOrderDetailRel As String

    Set rplFull = New JRO.Replica
    Set rplPartial = New JRO.Replica

    ' Set the ActiveConnection to the full replica
    Set rplFull.ActiveConnection = CurrentProject.Connection

    ' Step 1: Create the empty partial replica
    rplFull.CreateReplica ReplicaName:=<span style="background-color: #FFFF00; color: #000000; font-weight: bold">strPartial</span hi>, _
    Description:="Partial replica", _
    ReplicaType:=jrRepTypePartial
    Set rplFull = Nothing
    Debug.Print "Partial replica created."

    strConnect = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source =" & <span style="background-color: #FFFF00; color: #000000; font-weight: bold">strPartial</span hi> & ";"

    ' The PopulatePartial method requires an
    ' exclusive connection to the partial replica
    rplPartial.ActiveConnection = strConnect & _
    "Mode=Share Exclusive"

    rplPartial.Filters.Append "fermi", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "g1maz", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "g2maz", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "g3maz", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "g4maz", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "IDR_POT", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "MazG1K", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "MazG2K", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "MazG3K", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "MazG4K", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "tblsettings", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "PortDez23", _
    jrFilterTypeTable, True
    rplPartial.Filters.Append "PortMazz", _
    jrFilterTypeTable, True

    ' Step 2: Populate partial replica
    rplPartial.PopulatePartial CurrentProject.FullName
    Debug.Print "Partial replica populated."

    Set rplPartial = Nothing
    End Sub</font color=red> </pre>


    The code runs to completion but I can't see the partial replica that's supposed to have been created anywhere on the hard disk.
    I launch the above sub by typing
    <font color=448800>adhCreatePartialReplicaExample "scalve_bx.mdb"</font color=448800>
    in the immediate window and I guess I ought to find the partial replica named scalve_bx.mdb in the same folder where the full replica is but nothing shows up.
    One thing I don't understand is how the Data Source and the ReplicaName can be the same in the code above and even stranger is the fact that if I launch the sub once more I get a run-time error saying the database already exists.

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't Find Partial Replica (2003)

    Problem solved. The partial replica gets saved in the Documents folder which is not in the same hard disk as the full replica file.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't Find Partial Replica (2003)

    I've just opened the file created with the adhCreatePartialReplicaExample sub and, in the database window, it is indeed labelled as "Partial Replica" but it still contains all the tables that were originally in the full replica.
    Why could it be so?

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't Find Partial Replica (2003)

    Just realised the tables not appended to the Filters collection in the adhCreatePartialReplicaExample sub are still there yet empty.
    What happens to the empty tables when you synchronise the partial replica with the full one? Do they remain empty or are they filled up as well? Because the latter would defeat the purpose of creating a partial replica.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't Find Partial Replica (2003)

    They do remain empty and so the monologue is complete <img src=/S/yadda.gif border=0 alt=yadda width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •