Programming Transactional Subscriptions to an OLE DB Data Source

You can program the SQL Distribution control to synchronize data with OLE DB data sources. This feature allows applications to synchronize subscriptions to heterogeneous data sources. Prior to running the control, a linked server to the OLE DB database must be created at the Distributor and a heterogeneous Subscriber using the linked server must be created at the Publisher.

This example demonstrates how a Microsoft® Visual Basic® program can configure the SQL Distribution control to synchronize data with an OLE DB Subscriber:

Examples

'Initialize the replication control.

Dim oSQLDistribution As New SQLDistribution    

  

'Configure the control for an OLE DB subscription

oSQLDistribution.Publisher = "PublisherName"

oSQLDistribution.PublisherDatabase = "PublisherDatabaseName"

oSQLDistribution.Publication = "PublicationName"

oSQLDistribution.PublisherSecurityMode = DB_AUTHENTICATION

oSQLDistribution.PublisherLogin = "Login"

oSQLDistribution.PublisherPassword = "Password"

oSQLDistribution.SubscriberDatasourceType = OLEDB_DATASOURCE

'Set the Subscriber name to the OLE DB linked server

'named at the Distributor

oSQLDistribution.Subscriber = "SubscriberName"

oSQLDistribution.SubscriberDatabase = "SubscriberDatabaseName"

oSQLDistribution.SubscriptionType = PULL

  

‘Subscriber login information is not needed, if the OLE DB linked

‘server definition does not included login information

oSQLDistribution.SubscriberLogin = "Login"

oSQLDistribution.SubscriberPassword = "Password"

  

'Synchronize the data

oSQLDistribution.Initialize

oSQLDistribution.Run

oSQLDistribution.Terminate

  

See Also

Driver Support for Heterogeneous Data Sources

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.