Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

Pull Method

SQL Server 2000

Pull Method

Applications call the Pull method to extract data from a Microsoft® SQL Server™ database and stores that data in a table in a Microsoft SQL Server 2000 Windows® CE Edition (SQL Server CE) database.

Applies To

SQL Server CE RDA object

Syntax
object.Pull (LocalTableName, SQLSelectString, OLEDBConnectionString, RDA_TRACKOPTION, ErrorTableName)
Part Description
object SQL Server CE RDA object
LocalTableName Name of the SQL Server CE table that receives the extracted SQL Server records. An error occurs if the table already exists.
SQLSelectString Specifies which table, columns, and records to extract from the SQL Server database and store in the SQL Server CE database. This string can be any valid SQL statement that returns rows, including SELECT statements or stored procedures.
OLEDBConnectionString OLE DB connection string used when connecting to the SQL Server database.
RDA_TRACKOPTION Indicates whether SQL Server CE should track changes made to the pulled table. When indexes are requested, indexes that exist on the table being pulled are brought down to the device with the PRIMARY KEY constraints.
ErrorTableName Name of the local error table that is created if an error occurs when the Push method is later called to send changes back to SQL Server. This option can be specified only when RDA_TRACKOPTION is TRACKINGON.

The RDA_TRACKOPTION enum specifies whether the table being pulled to the device is tracked or not tracked.

Constant Value Description
TRACKINGON 1 SQL Server CE tracks all changes to the pulled table. PRIMARY KEY constraints related to the specified SQLSelectString are created on the local table. (Default)
TRACKINGOFF 0 SQL Server CE does not track changes to the pulled table. No PPRIMARY KEY constraints are created locally.
TRACKINGON_INDEXES 2 SQL Server CE tracks all changes to the pulled table. Indexes and PRIMARY KEY constraints that existed on the SQL Server table specified in SQLSelectString are created on the local table.
TRACKINGOFF_INDEXES 3 SQL Server does not track changes to the pulled table. Indexes and PRIMARY KEY constraints that existed on the SQL Server table specified in SQLSelectString are created on the local table.
Remarks

The InternetURL property must contain the URL of the SQL Server CE Server Agent.

The LocalConnectionString property must contain the OLE DB connection string for the SQL Server CE database on the Windows CE-based device.

The InternetLogin and InternetPassword properties must be specified if the SQL Server CE Server Agent is configured to use Basic authentication.

SQLSelectString controls which data is pulled from the SQL Server table. An error occurs if the resulting recordset contains an unsupported data type, such as timestamp. The SQLSelectString can specify a WHERE clause to control which records are returned. For example, SELECT * FROM Customers WHERE State='CA' retrieves customers who live in California only. SQLSelectString also supports stored procedures and views that return rows. SQLSelectString can also pull selected columns from multiple tables into a single table using TRACKINGOFF. For more information about data access and limitation, see Supported Data Types and Data Type Mappings and RDA Limitations.

RDA_TRACKOPTION specifies whether SQL Server CE should track changes to the pulled table. Specify TRACKINGON or TRACKINGON_INDEXES if you want to update the pulled table on the Windows CE-based device and then push changed records back to the original SQL Server table. When TRACKINGON is specified, PRIMARY KEY constraints are created on the pulled table. When TRACKINGON_INDEXES is specified, PRIMARY KEY constraints and related indexes are created on the pulled table. In both cases, SQL Server CE keeps track of every record that is inserted, updated, or deleted in the local table.

Note  An index is created only if the column(s) that makes up the index is pulled.

When the application calls the Push method, SQL Server CE uses the change tracking information to locate the inserted, updated, and deleted records in the local SQL Server CE table and propagate these changes back to SQL Server.

The following restrictions apply when RDA_TRACKOPTION is set to TRACKINGON or TRACKINGON_INDEXES:

  • An error occurs if the SELECT statement returns a nonupdatable recordset.
  • A primary key must be defined on the updatable recordset returned by the SELECT statement.
  • 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 TRACKINGON_INDEXES 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 CE local table specified in LocalTableName.

ErrorTableName specifies the name of the table in which Push errors should be stored. If an error arises when the application calls the Push method, SQL Server CE creates the error table and inserts a record in the table for each error that occurs. When the Push method completes, the application can examine the error table to determine whether errors have occurred. ErrorTableName can be specified only when TRACKINGON or TRACKINGON_INDEXES is specified. For more information about how the error table works, see RDA Conflict Detection and Resolution.

The client must have the appropriate security privileges to read the SQL Server table.

If SQL Server authentication is used, the user ID specified in OLEDBConnectionString must have the authority to read the SQL Server table.

If Windows authentication is used by setting INTEGRATED SECURITY="SSPI" in OLEDBConnectionString, the Internet user must have the authority to read the SQL Server table.

  • When Microsoft Internet Information Services (IIS) is configured to use Anonymous access, the Internet user runs under the identity of the Internet Guest Account (IUSR_computername). If you configure another Windows user account as the IIS anonymous user account, the Internet user runs under the identity of that account.
  • When IIS is configured to use Basic authentication, the Internet user runs under the identity of the Windows user account for which the client supplied the Internet user name and password.
  • When IIS is configured to use Integrated Windows authentication, the Internet user runs under the client's identity.

See Also
Configuring Security for Connectivity

OLE DB and SQL Server CE

RDA Object Methods

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.