I'm trying to create a partial replica from a full replica using the code
below which is in a standard vba module being part of the full replica mdb.
Public Sub adhCreatePartialReplicaExample( _
strPartial As String)
' Creates a new partial replica from
' the current replica
' and populates the new partial replica.
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:=strPartial, _
Description:="Partial replica", _
ReplicaType:=jrRepTypePartial
Set rplFull = Nothing
Debug.Print "Partial replica created."
strConnect = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPartial & ";"
' 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
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 from the immediate window typing:
adhCreatePartialReplicaExample "scalve_bx.mdb"
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.
What's going on?
grovelli - 04 Apr 2006 21:30 GMT
Problem solved. The partial replica gets saved in the Documents folder which
is not in the same hard disk as the full replica file.
I've just realised the tables not appended to the Filters collection in the
adhCreatePartialReplicaExample sub are still there in the partial replica 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.
David W. Fenton - 05 Apr 2006 14:45 GMT
> ' Step 2: Populate partial replica
> rplPartial.PopulatePartial CurrentProject.FullName
[quoted text clipped - 10 lines]
> scalve_bx.mdb in the same folder where the full replica is but
> nothing shows up. What's going on?
I'm no expert on partial replication (I don't see any value in it,
to be honest), but PopulatePartial works only for replicas that
already exist. If the replica doesn't already exist you have to do a
MakeReplica first and *then* the PopulatePartial
Actually, I'm not sure if this is the answer or not, as I realize
now that you're using JRO and not DAO. I don't believe in using JRO
for things that DAO can already do (which is the case with creating
and populating partial replicas).

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
grovelli - 07 Apr 2006 08:19 GMT
Thank you David, I've found they do remain empty upon synching them.
I use the CreateReplica method to create the replica.
Rudolf Ganglbauer - 01 Jun 2006 15:26 GMT
Hi grovelli,
is this code from the access developer's handbook? Does it work?
I tried something similar but without success. The problem is simply that I
cant get a connection to another replika. I like to sync 2 replicas in the
wan doing this from my front end (and not from a replica). Thats why
'currentProject.Connection' is not used.
rgds,
Rudolf
> I'm trying to create a partial replica from a full replica using the code
> below which is in a standard vba module being part of the full replica mdb.
[quoted text clipped - 74 lines]
> same folder where the full replica is but nothing shows up.
> What's going on?
David W. Fenton - 01 Jun 2006 21:42 GMT
> is this code from the access developer's handbook? Does it work?
> I tried something similar but without success. The problem is
> simply that I cant get a connection to another replika. I like to
> sync 2 replicas in the wan doing this from my front end (and not
> from a replica). Thats why 'currentProject.Connection' is not
> used.
I don't do JRO, but if you're synching over a LAN, then you *must*
be using indirect replication, which means you're not synching
between two replicas, but between two synchronizers. There was a JRO
thread just the other day about someone realizing that they had to
provide the synchronizer name to make it work.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Rudolf Ganglbauer - 02 Jun 2006 07:32 GMT
Hi David,
thanks for your quick reply. I will look for the other thread but at the
moment my code stuck already bulding the partial replica itself. When I
append a filter I always got an error message - somthing like 'invalid
expression in filters property' (free translation of german message)
do you have any idea how to create a partial replica (which is light weight
compared to a full replica of 1.5 GB) without JRO?
thanks for help,
Rudolf
> > is this code from the access developer's handbook? Does it work?
> > I tried something similar but without success. The problem is
[quoted text clipped - 8 lines]
> thread just the other day about someone realizing that they had to
> provide the synchronizer name to make it work.
David W. Fenton - 02 Jun 2006 13:49 GMT
> do you have any idea how to create a partial replica (which is
> light weight compared to a full replica of 1.5 GB) without JRO?
I have never seen the purpose of a partial replica so have never
investigated how they work (other than to create empty partial
replicas as a way of reviving indirect synchs that have gone awry).
I also don't use JRO.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/