"Raymond Mak [MSFT]" <rmak@online.microsoft.com> wrote in message
news:ufi4jZilGHA.408@TK2MSFTNGP03.phx.gbl...
> 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.cotter@gmail.com> wrote in message
> news:OEhjyKilGHA.3688@TK2MSFTNGP04.phx.gbl...
>> 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]" <rmak@online.microsoft.com> wrote in message
>> news:OjXkZDilGHA.5044@TK2MSFTNGP02.phx.gbl...
>>> 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.cotter@gmail.com> wrote in message
>>> news:uf3ihTglGHA.3688@TK2MSFTNGP04.phx.gbl...
>>>> 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]" <rmak@online.microsoft.com> wrote in message
>>>> news:earFBIWlGHA.1276@TK2MSFTNGP03.phx.gbl...
>>>>> 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.cotter@gmail.com> wrote in message
>>>>> news:ugDYixTlGHA.4348@TK2MSFTNGP05.phx.gbl...
>>>>>> 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