In addition to importing entire databases, with the ADOCE control you can copy selected tables from Microsoft Access .mdb files to a Windows CE–based device. Using the Import from Database to Mobile Device dialog box, you can select which tables and fields to convert to ADOCE databases.
To import a Microsoft Access table and field to a device
An Open dialog box appears.
The Import from Database to Mobile Device dialog box appears. The dialog box lists the tables and fields in the database.
You can also initiate the conversion by dragging the .mdb file to the device icon in the ActiveSync Mobile Devices window. This replaces steps 2 and 3 in the procedure. The following screen shot shows the Import from Database to Mobile Device dialog box.
The Import from Database to Mobile Device dialog box includes the following features:
This area of the dialog box provides a hierarchical view of the tables and fields in the Access database that are selected for conversion. To copy a table or field to a device, select the check box by the field name or table name. During the conversion process each selected Access table becomes a separate database in the Databases directory of Windows CE–based device. By default, all fields except OLE Object fields are automatically selected for conversion.
All tables list an extra Read-Only field that enables you to make the database table read-only on the device.
If you select this check box, ADOCE replaces an existing table with a converted table if the two tables share the same name. If you do not select this check box, the converter does not overwrite an existing table. Instead, the converter attempts to create a new name for the converted table by appending a number from 0 through 9 to the end of the table name. If ADOCE cannot generate a unique table name, it displays a dialog box showing that the table conversion has failed.
Choose the Default button to select the default fields for conversion. This automatically selects all fields, except OLE Object fields, for conversion. It clears the Read-Only fields. The defaults apply to all tables in the .mdb file.
The OK button starts the conversion of the selected tables. The Cancel button quits the conversion.
For each .mdb file that is imported, the converter generates a log file named Db2ce.txt in the partner directory for the device, usually in C:\Program Files\Windows CE Services\Profiles\devicename.
You may also choose to import tables from an ODBC data source.
To import data from an ODBC data source into a device
An Open dialog box appears.
The Import from Database to Mobile Device dialog box appears. The dialog box lists the tables and fields in the database.