Tip of the Month (October 2007)
Creating Visual CE Forms to Run on Desktop Computers Using Local or Remote Data
Visual CE is primarily a tool to build applications that run on a handheld. But, if the
Visual CE runtime system is installed on a desktop computer, a Visual CE form can also run
on the desktop.
Visual CE forms that run on the desktop using data on the desktop
Forms created to run on a handheld using data in the Windows CE Store (i.e. tables
created using Visual CE's FILE | CREATE TABLE or FILE | DOWNLOAD TABLE) can run
on the desktop without any modification. The Visual CE runtime system looks to the
synchronization settings (FILE | SYNCHRONIZE) to determine where the data is stored
on the desktop.
Say you have a form (MyForm.vce) built over a table (MyTable). Say that Visual CE's
synchronization settings specify that MyTable is to be synchronized to MyTable in
MyDatabase.mdb on the desktop. If, in File Explorer on the desktop, you navigate
to the form and double click it, the form will run and show data from MyTable in
MyDatabase.mdb.
Visual CE forms that run on the desktop using data on a server
Alternatively, You can use mEnable and run a form on the desktop against data on a server.
It's a little tricky, but it can be done. Here's how...
Note: You will need to get an mEnable license for each desktop client machine.
To build a form that runs on the desktop usingdata on a server:
- Install the mEnable server software on the mEnable server machine.
- Install the mEnable desktop client software on the desktop client machine (i.e., the machine
you want to run the applicaiton on).
- On the mEnable server machine, select START | SETTINGS and open up the ODBC Data
Sources (it might be under "Administrative Tools").
- Click the "File DSN" tab.
- Click "Add".
- Select the driver for your database (Access, SQL Server, etc. but NOT mEnable) and click
NEXT.
- Specify a name for the DSN (for example, MyDSN). Click NEXT. Click FINISH.
- You will see a configuration dialog for the driver. Fill in everything needed to make the
connection except the user name and password. For example, if you were using the SQL Server
driver, you would specify the name of the machine running SQL Server.
- Click OK to close the datasource configuration dialog.
- Click OK to close the ODBC administrator.
- Run the Visual CE development software on the mEnable server machine.
- Select FILE | NEW FORM. Select "Server Database'. Click YES to the warning.
- Pick the data source you selected in step (7) and click OK. Enter the username and
password (if need be) and click OK.
- Pick your table and click OK.
- Build your form as you normally would (without an mEnable stoplight control).
- OPTIONAL: Select FORM | PASSWORD and set the Host to the mEnable server machine.
- Save your form to the desktop (FILE | SAVE AS).
- Copy the form and the .DSN (they are both in the folder you specified in step (17) to
your desktop client machine.
To use this form on your desktop client machine, use File Explorer to navigate to the
form you copied in step (18) and double click the form.