PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV Mobile 24 feature!
  • This lesson will teach you the following concepts
  • Format of databases
  • HFSQL database
  • CEDB
  • AS/400
  • Sharing data between two applications
  • Handling the same data files
  • Copying the data files onto the mobile device (Pocket PC for example)
Lesson 7.2. Databases
This lesson will teach you the following concepts
  • Available databases.
  • Synchronization.

Estimated time: 30 mn
Previous LessonTable of contentsNext Lesson
Format of databases
A Windows Mobile application can handle data. The format of these databases can be:
  • HFSQL (in Classic or Client/Server mode), database system supplied with WINDEV Mobile.
  • CEDB, database system that can be used on mobile devices (Pocket PC).
  • AS/400, AS/400 database that can be used on mobile devices (Pocket PC).
  • ...

HFSQL database

HFSQL Classic
In HFSQL Classic mode, the data files are stored on the device.
In this case, the application is stand-alone. No Wi-Fi or 3G connection is required.
The data is stored in the device memory. The maximum storage size depends on the amount of memory on the device.
HFSQL Client/Server
In HFSQL Client/Server mode, no data is stored on the device. The data is stored on a computer on which a HFSQL server is installed.
To access this computer (and therefore the database), a method for communicating with the server must have been enabled in the mobile application (Wi-Fi or 3G) in order to connect via the network or Internet.
The response times depend on the quality of Wi-Fi or Internet network and on the amount of requested data.
The access to the data will be performed by the Hxxx functions of WLanguage and/or by SQL queries.

Example

The "Pocket Notes" and "Pocket Telephony" examples (supplied with WINDEV Mobile) are using HFSQL data files.
These examples are accessible from the WINDEV Mobile home page (Ctrl + <).
Caution: These examples are not available in Express version.

Note

During the test (in simulation mode) of a WINDEV Mobile application that handles HFSQL data files, the data files used are the ones found on the PC.

CEDB

The CEDB format is a database format that can be used on the mobile devices (Pocket PC).
A CEDB database corresponds to a ".CDB" file. A CEDB database can contain several data files (also called "tables").
Two types of CEDB databases are available:
  • the standard CEDB databases, that correspond to the databases found by default on the mobile device. These databases contain the following data files: "Tasks", "Contacts", "Appointments", ...
  • the other CEDB databases (called custom databases), that correspond to the Access databases (".MDB" file) previously exported from a PC.
Note: When an Access database (".MDB" file) is copied onto a mobile device (via the file explorer), this database is automatically changed into a CEDB database (".CDB" file).
A CEDB database can be handled:
  • from a WINDEV Mobile application.
  • from a WINDEV application.
These operations are performed by the cdbXXX functions of WLanguage.

Note

Caution: From Windows Mobile 5 onwards, a standard database (tasks, contacts, appointments, etc.) can no longer be accessed from a Window application (and therefore from a standard WINDEV application).
CEDB databases can be accessed from the PC, from the simulator, from the mobile device.
Standard databases can be accessed from the mobile device only.

Note

Caution: The structure of CEDB databases is not adapted to the process of large data amount. Therefore, we recommend that you use HFSQL databases. Furthermore, HFSQL allows you to benefit from all features available in WINDEV Mobile (RAD, file link, ...).

Note

During the test (in simulation mode) of a WINDEV Mobile application that handles a CEDB database, the database used is found on Pocket PC.

AS/400

This database format is accessible via a Native Connector (also know as Native Access) by Windows Mobile applications. To use this Native Connector, a module is required in addition to WINDEV Mobile.
Contact PC SOFT Sales Department for more details.
Sharing data between two applications
A WINDEV Mobile application for Windows Mobile can share data with a standard WINDEV application.
You have the ability to use:
  • a standard WINDEV application used to handle the entire database.
  • a WINDEV Mobile application used to handle the entire database or part of this database.
When two applications share the same data, the data files can be managed according to two different methods:
  • Handling the same data files:
    The two applications handle the same data files. These data files are found on the PC. The WINDEV Mobile application accesses the data files by Wi-Fi, by infrared, by GPRS, ... HSubstDir allows you to specify the data directory to use.

    For example: application for taking orders in a restaurant. The new orders are automatically sent to the database found on the PC.
  • Copying data files on the mobile device:
    All data files (or some of them) are copied onto each mobile device (Pocket PC for example) beforehand. Each application handles its own files. To take into account the modifications performed in each application, the data files must be synchronized (automatically or not).

    For example: poll application performed in the street. The answers will be available in the WINDEV application once the data files have been synchronized.

Handling the same data files

To allow the WINDEV Mobile application to access the data files found on the PC:
  • the mobile devices must have network access (Ethernet card, Wi-Fi, etc.)
  • the data found on the PC must be accessible in read/write via a UNC path (the directory used must be a shared directory).
Then, the data can be handled (addition, modification and deletion) by the HFSQL functions.

Example

Databases in HFSQL format (on the Pocket PC and on the PC)
The "Network tasks" example (supplied with WINDEV Mobile) includes a project that can be used on a Windows Mobile device (Pocket Network tasks) and a project that can be used on PC (PC Network tasks). These two examples use the data files found on the PC.
Caution: These examples are not available in Express version.

Copying the data files onto the mobile device (Pocket PC for example)

To update the data files found on the PC with the data typed on the mobile devices, all you have to do is synchronize the files.
If the data files used are in HFSQL format, all mobile devices must be connected one by one to the PC. The automatic HFSQL synchronization via ActiveSync takes everything in charge.
If the data files used are not in HFSQL format, you must program the synchronization between the WINDEV Mobile application and the WINDEV application. See the examples supplied with WINDEV Mobile for more details.

Example

Databases in HFSQL format (on the mobile device and on the PC)
The "Sending SMS", "Managing lists of purchases" and "Stocks" examples (supplied with WINDEV Mobile) include a project that can be used on mobile device (Pocket PC for example) and a project that can be used on PC. These examples present the synchronization of data typed in the two projects.
Caution: These examples are not available in Express version.
Previous LessonTable of contentsNext Lesson
Minimum version required
  • Version 24
Comments
Click [Add] to post a comment