Problem with partial replication

roypython

Registered User.
Local time
Tomorrow, 05:32
Joined
May 16, 2005
Messages
29
Hello everyone.
Your help is very much appreciated.
I am trying to create partial replica from the design master.
it all goes well until I try to set the filter using:
repPartial.Filters.Append "Customers",jrFilterTypeTable,"Customers.Region = 'CA' "
It throws an error:
"Invalid expression in the ReplicaFilter property".

The replica db, does contain "Customers" table, which has "Region" field.

Thank you for you help.
The code, looks like:

dim repFull as new JRO.Replica
repFull.ActiveConnection = "C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\northwind.mdb"
Call repFull.CreateReplica("C:\MY_REPLICA.mdb", "description", jrRepTypePartial)

Set repFull = Nothing
' open the partial replica in exclusive mode and apply filters
repPartial.ActiveConnection = "Data Source=C:\MY_REPLICA.mdb; Mode=Share Exclusive"
repPartial.Filters.Append "Customers", jrFilterTypeTable, "Customers.Region like 'CA' "

Cheers
Roy
 
If you look at it, what is the ReplicaFilter property currently set to, after you run your code?

Have you tried the DAO methods for setting a partial replica filter? I would use those instead of JRO, because they are native to the DAO library that is itself native to Access -- you don't need to add a reference to use them. The downside is that MS in their infinite stupidity has polluted all the replication documentation with JRO. However, I've noticed that they are updating a lot of it with the corresponding DAO versions. You might want to go back to the MS Knowledge Base and see if the partial replica filter examples there now include the DAO equivalent, and try that.

--
David W. Fenton
David Fenton Associates
http://dfenton.com/DFA/
 
Hi David.
thank you for your reply.
When I set the filter, it just throws error messages so it doesn't realy set the
filter.
I tried to use JRO, than looked at ADO - and it's not such a flash option either.
After spending about a week trying to figure out a way,
I just added to the menu barm a button that launches the partial replication wizard, and equiped the client with lots of explanations of how to use it.
One of the misteries, is why doe it work so smoothly with the wizard, but for JRO and ADO is a nightmare?
 
When I set the filter, it just throws error messages so it doesn't realy set the filter.

Is the filter poperty blank, or does it not exist yet?

I tried to use JRO, than looked at ADO - and it's not such a flash option either.

ADO doesn't know replication (which is the whole reason JRO exists, to provide access to Jet functionality that is lacking from ADO; the result is that ADO+JRO has the same basic functionality set as DAO by itself). It's DAO that you need, which is Jet's native data access interface, and is now the Microsoft-recommended method for working programmitically with Jet data (i.e., ADO is now deprecated for Jet data).

After spending about a week trying to figure out a way, I just added to the menu barm a button that launches the partial replication wizard, and equiped the client with lots of explanations of how to use it. One of the misteries, is why doe it work so smoothly with the wizard, but for JRO and ADO is a nightmare?

You still don't appear to have tried DAO for the partial replica filter assignment. Did you look into that at all?

--
David W. Fenton
David Fenton Associates
http://dfenton.com/DFA/
 

Users who are viewing this thread

Back
Top Bottom