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 (March 2008)

Dividing a Table Among Different Handhelds

Say you have a table on the desktop/server called MyTable. Say you have three handhelds named Alpha, Beta, and Gamma (the handhelds are identified by the name specified in START | SETTINGS | SYSTEM | ABOUT | DEVICE ID...see note below). You can set things up so some of the records in MyTable are synchronized with Alpha, some with Beta, and a some with Gamma.

Normally MyTable on the handheld would synchronize to MyTable on the desktop/server. But you can set things up so MyTable on Alpha synchronizes to Alpha_MyTable on the desktop/server, MyTable on Beta synchronizes to Beta_MyTable on the desktop/server, and MyTable on Gamma synchronizes to Gamma_MyTable on the desktop/server. Please note the naming convention: the handheld name, followed by an underscore, followed by the table name.

Furthermore, Alpha_MyTable, Beta_MyTable, and Gamma_MyTable do not have to be tables. They can be views (MS Access calls these "queries") so long as they are updatable views. And these views can be views over MyTable.

You can define these three views to include or not include whatever records you want. Most likely, there will be a column (perhaps called Owner) in MyTable specifying which hanheld the record belongs to. In the records for the Alpha handheld, Owner would be set to "Alpha"; in the records for the Betaa handheld, Owner would be set to "Beta"; in the records for the Gamma handheld, Owner would be set to "Gamma". You then define the Alpha_MyTable view (query) to be those records with Owner set to "Alpha", the Beta_MyTable view (query) to be those records with Owner set to "Beta", and the Gamma_MyTable view (query) to be those records with Owner set to "Gamma".

So, all that is left to do is to convince the Visual CE synchronizer to synchronize MyTable on the handheld to Alpha_MyTable, Beta_MyTable, or Gamma_MyTable on the desktop/server (depending on which handheld is being synchronized). Here's how to do this:

  1. Create MyTable in the desktop/server database.
  2. Use Visual CE and download MyTable to one of the handhelds (FILE | DOWNLOAD TABLE).
  3. Create a form over MyTable.
  4. Give each handheld a unique name (see note below).
  5. Create the views (queries) in the desktop/server database (being sure to use the _ naming convention).
  6. Turn on the name mapping. You do this by editing a file onthe desktop called WCEODBC.INI that is in the windows folder using a text editor such as notepad. Change

Note: On Windows Mobile Standard Smartphones (phones without a touch screen), it may be difficult to see the name of the handheld (Alpha, Beta, or Gamma). This desktop utility can be used to display and change the name of the handheld connected to the desktop.

Previous Tips of the Month