|
|
|
|
- Accessing a database found on Mobile Device (Pocket PC)
- Managing the columns found in the standard databases of Mobile Device (tasks, contacts, ...)
- New DateTime value
cdbWriteCol (Function) In french: cdbEcritCol Modifies the value of a column for a record in memory. To apply this modification to the physical file, use cdbAdd or cdbModify. 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 |
Remark: To modify the value of a column for a record found in a standard database of Mobile Device, we recommend that you use the variables of the structure of standard databases.
// Add a record into Customer file cdbWriteCol("MyDatabase", "Customer", "LastName", "Smith") cdbWriteCol("MyDatabase", "Customer", "FirstName", "Paul") cdbWriteCol("MyDatabase", "Customer", "City", "Avignon") ResAdd = cdbAdd("MyDatabase", "Customer")
Syntax
<Result> = cdbWriteCol(<Database> , <Data file> , <Column> , <New value> [, <Option>])
<Result>: Boolean - True if the function was successful,
- False otherwise. If an error occurs, you can get the details of the error with ErrorInfo.
<Database>: Character string (with quotes) - Name of database that was opened by cdbOpen,
- Empty string ("") to handle one of the standard databases found on 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 (""), cdbWriteCol handles the last file used by the last function for managing the Mobile Device databases (starting with the letters 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 the <Option> parameter.
- 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. See remarks for more details. <New value>: Type of the new value New value for the specified column. The NULL value can be specified. <Option>: Optional integer constant If <Column> corresponds to the identifier of the column, the cdbFromIdentifier constant must be specified. Remarks Accessing a database found on 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:
cdbWriteCol("", cdbContact, CDB_CONTACT_NAME, "Smith")
If <New Value> contains a DateTime value and if <Column> corresponds to an 'unsigned 8-byte integer' column, <New Value> is automatically converted into the format of the column. Therefore, there is no need to use cdbDateTimeToInteger.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|