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 (November 2009)

File Pathname Mapping When Running Forms on the Desktop

A Visual CE form can be run on the desktop. Just set up synchronization for the tables the form uses, navigate to the form on the desktop, and double click it. When the form runs on the desktop, it reads/writes its data to the database identified by the synchronization settings.

But what about the file pathnames? Throughout the form there are file pathnames for things like background images for scribble boxes or forms to jump to. These file pathnames are expressed in terms of the file system on the handheld. And, of course, the desktop file system is not laid out the same way.

In the manual, the topic "Setting Up Visual CE Applications to Run on a Desktop PC" explains how to use the ActiveSync synchronizer to get these files to the desktop so Visual CE can see them.

This worked well on Windows XP and earlier versions of Windows, but the Widows Mobile Device Center in the newer versions of Windows (like Windows Vista, Windows 7), no longer reports the true location of the file synchronization folders to Visual CE. Consequently, it is up to you to specify where the desktop and handheld synchronization folders are located. Luckily, this is not difficult at all.

Let's say your desktop file synchronization folder is

    C:\Users\SYWARE\Documents\Documents on SYWARE's PDA
and your handheld synchronization folder is
    \My Documents
Using a text editor such as notepad open a file called WCEODBC.INI that is in the windows folder of your desktop machine. Change
    [VICESYNC]
to:
    [VICESYNC]
    DesktopRoot=C:\Users\SYWARE\Documents\Documents on SYWARE's PDA
    HandheldRoot=\My Documents

When a form runs on the desktop, it will use these settings to map handheld file pathnames to desktop file pathnames.


Previous Tips of the Month