mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (December 2005)

Adding an OID Column to an Existing Table

Visual CE's synchronizer requires an additional column be added to the desktop/server table. Visual CE uses this column to correlate the records on the desktop/server with records on the handheld. This column must be the first column of the table, it must be called OID, and its datatype must be able to hold a long integer (four byte integer).

The addition of this column may cause difficulties for legacy applications that don't expect to see this column. Here's how to accomodate these applications.

Say you have a table called MY_TABLE. Rename the table to MY_TABLE_WITH_OID and add the OID column to MY_TABLE_WITH_OID. Then, create a view (Microsoft Access calls these "queries") over MY_TABLE_WITH_OID called MY_TABLE. The MY_TABLE view should include all the columns of MY_TABLE_WITH_OID except the OID.

Your legacy applications will continue to use MY_TABLE (which now indicates the view, rather than the table) and Visual CE can use MY_TABLE_WITH_OID.