Requirements for Using Replication ActiveX Controls in Development Environments

Replication Programming

Replication Programming

Requirements for Using Replication ActiveX Controls in Development Environments

This section explains how to use the SQL Distribution control, SQL Merge control, and SQL Snapshot control in Microsoft® Visual Basic® and Microsoft Visual C++® development environments.

Microsoft Visual Basic

To use one or more Microsoft ActiveX® replication controls in a Microsoft Visual Basic program: on the Project/References menu in the Visual Basic Development Environment, in the References dialog box, select the .dll references for the controls you plan to use.

Component Reference Library
SQL Distribution Control Microsoft SQL Distribution Control 8.0 sqldistx.dll
SQL Merge Control Microsoft SQL Merge Control 8.0 sqlmergx.dll
SQL Snapshot Control Microsoft SQL Snapshot Control 8.0 sqlinitx.dll
Replication Errors Microsoft SQL Replication Errors 8.0 replerrx.dll

If Microsoft SQL Server™ 2000 was installed to the default locations, these component .dlls are located in C:\Program Files\Microsoft SQL Server\80\COM\.

Microsoft Visual C++

To use the one or more replication controls in a Microsoft Visual C++ program, include the files from the Include Files column of the following table in the appropriate source files of your project. These files are installed on your computer only if Headers and Libraries was selected in Development Tools during a custom installation of the SQL Server 2000 client tools.

Reference the files from the Libraries column of the table in your project or NMAKE file. These files are installed automatically during a typical installation of the SQL Server 2000 client tools.

Component Include Files Libraries
SQL Distribution Control sqldistx.h
repldstx.c
sqldistx.dll
SQL Merge Control sqlmergx.h
replmrgx.c
sqlmergx.dll
SQL Snapshot Control sqlinitx.h
replinix.c
sqlinitx.dll
Replication Errors replerrx.h replerrx.dll

If SQL Server 2000 was installed to the default locations, the files in the Include Files column are located in C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include\. The files in the Libraries column are located in C:\Program Files\Microsoft SQL Server\80\COM\.

After the controls are referenced, they can be included in the Components toolbar; however, these controls are not user interface controls. Drawing the controls on the form will not instantiate them. The controls need to be instantiated with the NEW keyword. In addition, a variable of the ActiveX object's class can be declared using the WithEvents keyword. This enables the program to receive callbacks from the agents, and the application can cancel the ActiveX object in this callback function. The callback is also available with the ReplErr object, although it is a notify callback and not a status callback.

See Also

Replication ActiveX Control Reference