all groups > sql server replication > june 2006 >
You're in the

sql server replication

group:

Replication from SQL Server 2005 to SQL Express using RMO


Replication from SQL Server 2005 to SQL Express using RMO Aaron Peronto
6/21/2006 5:39:02 AM
sql server replication:
I am having a problem with getting merge replication to work between a SQL
2005 Publication and a SQL Express subscriber using RMO in a C# windows app.
Everything I have read indicates that you can use a MergePullSubscription
object, set the values for DatabaseName, PublisherName, PublicationName,
PublicationDBName and call LoadProperties(). Following that, (because it is
a SQL Express subscriber) you should use the .SynchronizationAgent from the
pull subscription and call the .synchronize method. However, my Agent is not
a valid object. The load properties appears to work but when I try to
reference the Agent and call the synch method it fails.

I tried to use the sample code from the SQL 2005 replication samples as a
base but am still unable to determine where the problem lies.
Any other refernces out there or any suggestions/ideas of things to try?
Re: Replication from SQL Server 2005 to SQL Express using RMO Hilary Cotter
6/21/2006 10:11:21 AM
Why are you using RMO? Its far more difficult to use RMO than the activeX
controls. I would advise you to use them.

let me know if you need code

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Raymond Mak [MSFT]
6/21/2006 11:31:22 AM
Hi Aaron,

It would be great if you can post the error text that you were receiving and
perhaps the code snippet that you are having problems with. In the absence
detail at this moment, I would hazard a guess that your project is missing a
reference to the Microsoft.SqlServer.Replication.dll assembly.

-Raymond

[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Raymond Mak [MSFT]
6/21/2006 11:39:15 AM
Hi Hilary,

Since we do plan to replace the ActiveX controls with the managed
synchronization agent classes in RMO some time in the future, we are very
much interested in knowing why you feel the ActiveX controls are easier to
use than the RMO classes and perhaps we can incorporate your feedback in the
design of the RMO classes for a future release.

-Raymond

[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Hilary Cotter
6/22/2006 10:06:33 AM
ActiveX involves far less code, objects, classes etc. It is limited to
pulling or pushing and generating a snapshot. The publication must exist
already.

RMO is just like DMO, but only contains the replication components. Still
you have to navigate through everything which is <sarcasm>extraordinarily
well documented</sarcasm> and its a lot of hoops to jump through.

Granted that you don't get a lot of info when your activeX control fails on
you and you can't really set many parameters other than what's in the
profile.

I bet you a beer or two if you write two projects, one using ActiveX, and
one using RMO, you'll never go back to RMO.

Note that Paul Ibison was an early proponent or RMO and he had a full head
of hair at that time. Have a look at pictures of him today. I rest my point.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Raymond Mak [MSFT]
6/22/2006 10:25:22 AM
Ermm, the SynchronizationAgent classes in
Microsoft.SqlServer.Replication.dll are actually thin wrappers on top on the
ActiveX controls which you can instantiate directly even from within a
VBScript such as:

Dim oTransSynchronizationAgent
Set oTransSynchronizationAgent =
WScript.CreateObject("Microsoft.SqlServer.Replication.TransSynchronization")

Granted that you can do the same with the ActiveX controls but then again I
really want my beer :)

-Raymond

[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Raymond Mak [MSFT]
6/22/2006 11:05:02 AM
Here we go, one fewer line :)

option explicit

Const DB_AUTHENTICATION = 0
Const NT_AUTHENTICATION = 1
Const TRANSACTIONAL = 1
Const ANONYMOUS = 2
Const PULL = 1
Const FILETRANSFERFTP = 1

dim objSQLDist, objNetwork

Set
objSQLDist=WScript.CreateObject("Microsoft.SqlServer.Replication.TransSynchronizationAgent")

Set objNetwork = Wscript.CreateObject("Wscript.Network")

objSQLDist.Publication="northwind1"
objSQLDist.Publisher=objNetwork.ComputerName
objSQLDist.PublisherDatabase="Northwind"
objSQLDist.PublisherSecurityMode=DB_AUTHENTICATION
objSQLDist.PublisherLogin="tran"
objSQLDist.PublisherPassword="tran"
objSQLDist.FileTransferType=FILETRANSFERFTP
objSQLDist.Subscriber=objNetwork.ComputerName
objSQLDist.SubscriptionType=ANONYMOUS
objSQLDist.SubscriberSecurityMode=DB_AUTHENTICATION
objSQLDist.SubscriberLogin="tran" 'tran is in the dbo_role in the database
transub
objSQLDist.SubscriberPassword="tran"
objSQLDist.SubscriberDatabase="transub"

objSQLDist.Synchronize

Although I think we both need to specify the distributor login information
for this to be a complete sample...

-Raymond
[quoted text, click to view]
Re: Replication from SQL Server 2005 to SQL Express using RMO Hilary Cotter
6/22/2006 1:40:00 PM
Sure that's one statement of quite a few. You have to drill down to get
there.

Here's a complete activex programming code sample. Show me a complete RMO
sample with less lines. Note that if I were to use NT authentication and a
unc deployment I could use less lines.

option explicit

Const DB_AUTHENTICATION = 0
Const NT_AUTHENTICATION = 1
Const TRANSACTIONAL = 1
Const ANONYMOUS = 2
Const PULL = 1
Const FILETRANSFERFTP = 1

dim objSQLDist, objNetwork

Set objSQLDist=CreateObject("SQLDistribution.SQLDistribution.2")

Set objNetwork = Wscript.CreateObject("Wscript.Network")

objSQLDist.Publication="northwind1"
objSQLDist.Publisher=objNetwork.ComputerName
objSQLDist.PublisherDatabase="Northwind"
objSQLDist.PublisherSecurityMode=DB_AUTHENTICATION
objSQLDist.PublisherLogin="tran"
objSQLDist.PublisherPassword="tran"
objSQLDist.FileTransferType=PULL
objSQLDist.Subscriber=objNetwork.ComputerName
objSQLDist.SubscriptionType=ANONYMOUS
objSQLDist.SubscriberSecurityMode=DB_AUTHENTICATION
objSQLDist.SubscriberLogin="tran" 'tran is in the dbo_role in the database
transub
objSQLDist.SubscriberPassword="tran"
objSQLDist.SubscriberDatabase="transub"

objSQLDist.Initialize
objSQLDist.Run

If we every hook up, I'll buy you a beer or two. Otherwise send me a mailing
address and I'll mail you a freshly poured one:)

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Replication from SQL Server 2005 to SQL Express using RMO Hilary Cotter
6/22/2006 1:51:21 PM
Looks like your correct Raymond. Sorry about that. I was totally unaware you
could use it like that.

Thanks for the tip. Send me an address for the beer:)

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]
Re: Replication from SQL Server 2005 to SQL Express using RMO Hilary Cotter
6/22/2006 2:11:21 PM
but my code is prettier than yours:)

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]
Re: Replication from SQL Server 2005 to SQL Express using RMO Jordi corominas
7/5/2006 5:20:32 AM

Nice thread! :)

AddThis Social Bookmark Button