|
|
|
|
- Accessing a database found on the Mobile Device (Pocket PC)
- Managing the columns found in the standard databases of Mobile Device (tasks, contacts, ...)
- Limitation: Standard database of Mobile Device
- Character string result
cdbCol (Function) In french: cdbCol Returns a characteristic of a column found in the current record (value, type, identifier or name) in a standard database of Mobile Device or in a ".CDB" database. Caution: From Windows Mobile 5, the access to a standard database (tasks, contacts, appointments, ...) can no longer be performed from a Windows application (and therefore from a standard WINDEV application). | | | | | Accessible from the PC | Accessible from the simulator | Accessible from the Mobile Device (Pocket PC) | CDB database | Yes | Yes | Yes | Standard database | No | No | Yes |
// Find out the name of column 2 ResName = cdbCol("MyDatabase", "Customer", 2, cdbName) // Display the name Info("The name of column 2 is: " + ResName)
// Find out the value of column whose identifier is 3A1601F ResValue = cdbCol("MyDatabase", "Customer", OX3A16001F, cdbValue + cdbFromIdentifier) // Display the returned value Info("The value is: " + ResValue)
// Find out the type of "Company" column ResType = cdbCol("MyDatabase", "Customer", "Company", cdbType) // Display the returned value SWITCH ResType CASE hItemBoolean: Info("The item is a boolean.") CASE hItemInteger2: Info("The item is a 2-byte integer.") CASE hItemInteger4: Info("The item is a 4-byte integer.") CASE hItemReal8: Info("The item is a real.") CASE hItemText: Info("The item is a string.") END
Syntax
<Result> = cdbCol(<Database> , <Data file> , <Column> [, <Characteristic>])
<Result>: Type of requested characteristic - Requested characteristics,
- Empty string ("") if an error occurred. To get the details of the error, use ErrorInfo.
If the column type is requested, the available constants are as follows:
| | hItemBoolean | Boolean | hItemText | Character string | hItemInteger2 | 2-byte integer | hItemInteger4 | 4-byte integer | hItemUnsignedInteger2 | Unsigned 2-byte integer | hItemUnsignedInteger4 | Unsigned 4-byte integer | hItemUnsignedInteger8 | Unsigned 8-byte integer | hItemBinaryMemo | Memo | hItemReal8 | 8-byte real |
<Database>: Character string (with quotes) - Name of database that was opened by cdbOpen,
- Empty string ("") to handle one of the standard databases of the Mobile Device (tasks, contacts, ...).
<Data file>: Character string (with quotes) Data file to use. This parameter corresponds to:- the name of data file to use.
- the constant corresponding to one of the standard databases:
| | cdbContact | "Contacts" database | cdbTask | "Tasks" database | cdbAppointment | "Appointments" database |
If this parameter corresponds to an empty string (""), cdbCol handles the last file used by the last function for managing the Mobile Device databases (starting with cdb). <Column>: Integer or character string (with quotes) Column to use. This parameter can correspond to:- the name of the column.
- the identifier of the column. In this case, the cdbFromIdentifier constant must be specified in <Characteristic>.
- the subscript of the column.
For a standard database of the Mobile Device (tasks, contacts, ...), use one of the constants found in the "cdbConst.WL" file. For more details, see remarks. <Characteristic>: Optional Integer constant Requested characteristic:
| | cdbIdentifier | Returns the custom identifier of column | cdbName | Returns the column name | cdbType | Returns the column type | cdbValue (Default value) | Returns the column value |
If <Column> corresponds to the identifier of the column, the cdbFromIdentifier constant must be specified. Remarks Accessing a database found on the Mobile Device (Pocket PC) The table below presents the actions that must be performed to access a database found on Mobile Device: | | | | Database | Standard database (tasks, contacts, appointments, ...) | Standard WINDEV application | - Establish a connection between the current computer and the Mobile Device (ceConnect).
- Open the database to use (cdbOpen).
| Establish a connection between the current computer and the Mobile Device (ceConnect). | WINDEV Mobile application | Open the database to use (cdbOpen). | No specific action is required. | Reminder: From Windows Mobile 5, the access to a standard database (tasks, contacts, appointments, ...) can no longer be performed from a Windows application (and therefore from a standard WINDEV application). Managing the columns found in the standard databases of Mobile Device (tasks, contacts, ...) To manage the different columns found in the standard databases of Mobile Device (tasks, contacts, ...): 1. Include the "cdbConst.wl" file in your project. This file lists all the identifiers of the columns found in the standard databases of Mobile Device (tasks, contacts, ...). To use this file in your project, the EXTERN keyword must be specified as follows:
// -- Initialization code of project EXTERN "cdbConst.wl"
2. Use the constants found in the "cdbConst.wl" file:
ResValue = cdbCol("", cdbContact, CDB_CONTACT_NAME, cdbValue + cdbFromIdentifier)
Limitation: Standard database of Mobile Device You cannot find out the name of the columns found in a data file that belongs to a standard database of the Mobile Device (tasks, contacts, ...).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|