Programming Transactional Subscriptions to an ODBC Data Source

The SQL Distribution control can be programmed to synchronize data with ODBC data sources. This allows for applications to synchronize subscriptions to heterogeneous data sources. Prior to using the SQL Distribution control, an ODBC data source name (DSN) must be created at the Distributor.

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

Examples

'Initialize the replication control.

Dim oSQLDistribution As New SQLDistribution    

  

'Configure the control for an ODBC subscription

oSQLDistribution.Publisher = "PublisherName"

oSQLDistribution.PublisherDatabase = "PublisherDatabaseName"

oSQLDistribution.Publication = "PublicationName"

oSQLDistribution.PublisherSecurityMode = DB_AUTHENTICATION

oSQLDistribution.PublisherLogin = "Login"

oSQLDistribution.PublisherPassword = "Password"

oSQLDistribution.SubscriberDatasourceType = ODBC_DSN

oSQLDistribution.Subscriber = "SubscriberName"    ‘ The ODBC DSN

oSQLDistribution.SubscriptionType = ANONYMOUS

  

'Subscriber login information. Only needed, if the ODBC DSN does not include 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.