1. create a IDBMgr object
-->ISHELL_CreateInstance( .... AEECLSID_DBMGR ... )
2. open database
--> IDatabase IDBMGR_OpenDatabase(......)
once database is open, IDBMgr is not longer needed
3. Create Record
--> set fType, fName, wDataLen, pBuffer
--> IDATABASE_CreateRecord( .... AEEDBField ....)
4. Record Reset, Update, Delete, Get
Simplifying Access to BREW Databases
The IDatabase Interface functions allow you to create and access records in databases created and opened with the IDBMgr Interface.
To obtain an instance of the IDatabase Interface , you call IDBMGR_OpenDatabase() to open the desired database.
You then use the IDatabase Interface pointer returned by this function to access the database with the operations described below.
You can also use functions in the IDBRecord Interface to access the fields of individual database records.
When you have completed access to the database, you call IDATABASE_Release() to close it.
The IDATABASE_CreateRecord() function creates a new record and adds it to your database (the function IDBRECORD_Remove() is used to remove a record from the database). Each record contains one or more fields.
Each field is defined by the AEEDBField structure, which includes the following elements:
The field name is a descriptor of the field's contents, (name, phone number, email address, etc.) The AEEDBFieldName enumerated type contains constants for commonly used field names.
The field type gives the data type of the field (byte, word, double-word, character string, binary, phone number or bitmap).
The field buffer pointer is a pointer to the actual contents of the field.
- The field length is the length in bytes of the field contents.