Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Replication from SQL Server 2005 to SQL Express using RMO

5 views
Skip to first unread message

Hilary Cotter

unread,
Jun 21, 2006, 10:11:21 AM6/21/06
to
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

"Aaron Peronto" <Aaron Per...@discussions.microsoft.com> wrote in message
news:172851E8-577D-455C...@microsoft.com...
>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?
>


Raymond Mak [MSFT]

unread,
Jun 21, 2006, 2:31:22 PM6/21/06
to
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

Raymond Mak [MSFT]

unread,
Jun 21, 2006, 2:39:15 PM6/21/06
to
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

"Hilary Cotter" <hilary...@gmail.com> wrote in message
news:ugDYixTl...@TK2MSFTNGP05.phx.gbl...

Hilary Cotter

unread,
Jun 22, 2006, 10:06:33 AM6/22/06
to
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

"Raymond Mak [MSFT]" <rm...@online.microsoft.com> wrote in message
news:earFBIWl...@TK2MSFTNGP03.phx.gbl...

Raymond Mak [MSFT]

unread,
Jun 22, 2006, 1:25:22 PM6/22/06
to
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

"Hilary Cotter" <hilary...@gmail.com> wrote in message

news:uf3ihTgl...@TK2MSFTNGP04.phx.gbl...

Hilary Cotter

unread,
Jun 22, 2006, 1:40:00 PM6/22/06
to
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

"Raymond Mak [MSFT]" <rm...@online.microsoft.com> wrote in message

news:OjXkZDil...@TK2MSFTNGP02.phx.gbl...

Hilary Cotter

unread,
Jun 22, 2006, 1:51:21 PM6/22/06
to
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

"Hilary Cotter" <hilary...@gmail.com> wrote in message
news:OEhjyKil...@TK2MSFTNGP04.phx.gbl...

Raymond Mak [MSFT]

unread,
Jun 22, 2006, 2:05:02 PM6/22/06
to
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
"Hilary Cotter" <hilary...@gmail.com> wrote in message

news:OEhjyKil...@TK2MSFTNGP04.phx.gbl...

Hilary Cotter

unread,
Jun 22, 2006, 2:11:21 PM6/22/06
to
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

"Raymond Mak [MSFT]" <rm...@online.microsoft.com> wrote in message

news:ufi4jZi...@TK2MSFTNGP03.phx.gbl...

Jordi corominas

unread,
Jul 5, 2006, 8:20:32 AM7/5/06
to

Nice thread! :)

*** Sent via Developersdex http://www.developersdex.com ***

0 new messages