The RDA_TRACKOPTIONenumeration specifies whether changes to the table on the device are tracked.

Members

The following table lists and describes the enumerators of the RDA_TRACKOPTION enumeration and their corresponding values.

Member name

Value

Description

TRACKINGOFF

0

SQL Server Compact 3.5 does not track changes to the pulled table. No PRIMARY KEY constraints are required or created on the local table.

TRACKINGON

1

SQL Server Compact 3.5 tracks all changes to the pulled table. PRIMARY KEY constraints related to the specified SQLSelectString are created on the local table. This is the default setting.

TRACKINGONWITHINDEXES

2

SQL Server Compact 3.5 tracks all changes on the local table. Indexes and PRIMARY KEY constraints on the SQL Server table specified in SQLSelectString are created on the local table.

TRACKINGOFFWITHINDEXES

3

SQL Server does not track changes to the pulled table. However, indexes and PRIMARY KEY constraints on the SQL Server table specified in SQLSelectString are created on the local table.

When TRACKINGON or TRACKINGONWITHINDEXES is specified, SQL Server Compact 3.5 keeps track of every record that is inserted, updated, or deleted in the local table. When TRACKINGON is specified, PRIMARY KEY constraints are created on the pulled table. When TRACKINGONWITHINDEXES is specified, PRIMARY KEY constraints and related indexes are created on the pulled table. Indexes are created only if the columns that make up the index are pulled.

The following restrictions apply whenRDA_TRACKOPTION is set to TRACKINGON or TRACKINGONWITHINDEXES:

  • An error occurs if the SqlSelectString statement returns a non-updatable recordset.

  • A primary key must be defined on the updatable recordset that the SELECT statement returns.

  • The SELECT statement can reference a view or stored procedure, but the view or stored procedure must reference only one table and must be updatable.

  • When TRACKINGONWITHINDEXES is specified, indexes that exist on the SQL Server table and are relevant to the columns specified in SQLSelectString are created against the SQL Server Compact 3.5 local table specified in LocalTableName.

Note   You must specify TRACKINGON or TRACKINGONWITHINDEXES if users will update the pulled table on the device and then push the changed records back to the original SQL Server table. When the application calls the Push method, SQL Server Compact 3.5 uses the change tracking information to locate the inserted, updated, and deleted records in the local SQL Server Compact 3.5 table and propagate these changes back to SQL Server.

Other Resources

Remote Data Access Programming (SQL Server Compact)