![]() ![]() ![]()
|
SophiaFramework UNIVERSE 5.3 |

| BREW 2.0 | BREW 2.1 | BREW 3.1 | BREW 4.0 |
|---|---|---|---|
| O | O | O | O |
| Public Functions | |
|---|---|
| VoidPtr |
GetField(
AEEDBFieldName* name
, AEEDBFieldType* type
, UInt16Ptr length
)
Get the raw data, type, name and length of the current field.
|
| Bool |
GetFieldDWord(
UInt32Ptr field
)
Get the 4-byte value of current field if the field type is AEE_FT_DWORD.
|
| WCharPtr |
GetFieldString( Void )
Get the string of current field if the field type is AEEDB_FT_STRING.
|
| Bool |
GetFieldWord(
UInt16Ptr field
)
Gget the 2-byte value of current field if the field type is AEE_FT_WORD.
|
| UInt16 |
GetID( Void )
Get the ID of the specified record.
|
| AEEDBFieldType |
NextField(
AEEDBFieldName* name
, UInt16Ptr length
)
Get the next field in current record.
|
| SFCError |
Remove(
SFBDBRecordSmpPtr record
)
Remove a record from the database and frees the SFBDBRecord object.
|
| Void |
Reset( Void )
Make the first field of record the current field.
|
| SFCError |
Update(
AEEDBField* fields
, SInt32 fieldsCount
)
Update a record given a new set of field values.
|
| Protected Functions | |
|---|---|
| static SFBBaseSmp |
FactoryByCreate(
AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface.
|
| static SFBBaseSmp |
FactoryByQuery(
SFBQuerySmpConstRef query
, AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.
|
[ public ] VoidPtr GetField( AEEDBFieldName* name // pointer to the field name AEEDBFieldType* type // pointer to the field type UInt16Ptr length // pointer to length of the field (in bytes) );
Get the content of current field.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
UInt16 len;
VoidPtr data;
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database.
record = database->GetRecordByID(3);
// get next field
fieldType = record->NextField(&fieldName, &len);
// get the content of this field
data = record->GetField(&fieldName, &fieldType, &len);
BREW API IDBRECORD_GetField | AEEDBFieldType | AEEDBFieldName
Get the 4-byte value of current field.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
UInt16 len;
UInt32 val;
// open database.
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database
record = database->GetRecordByID(0);
// get next field
fieldType = record->NextField(&fieldName, &len);
// get the 4-byte value of this field
record->GetFieldDWord(&val);
[ public ] WCharPtr GetFieldString(Void);
Get the string of current field.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
UInt16 len;
SFXWideString str;
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database.
record = database->GetRecordByID(5);
// get next field
fieldType = record->NextField(&fieldName, &len);
// get the string of this field
str = SFXWideString(record->GetFieldString());
Get the 2-byte value of current field.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
UInt16 len;
UInt16 val;
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database
record = database->GetRecordByID(0);
// get next field
fieldType = record->NextField(&fieldName, &len);
// get the 2-byte value of this field
record->GetFieldWord(&val);
[ public ] UInt16 GetID(Void);
Get the ID of the specified record.
// create SFBDataMgr Interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
UInt16 id;
// create a field for record.
UInt32 val = 32;
AEEDBField field = {AEEDB_FT_DWORD, AEEDBFIELD_TEXT, 1, &val};
// open database.
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// create a record in database.
record = database->CreateRecord(&field, 1);
// get the ID of this record.
id = record->GetID();
[ public ] AEEDBFieldType NextField( AEEDBFieldName* name // pointer to the next field name UInt16Ptr length // pointer to length of the next field );
Get the next field in the record.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
UInt16 size;
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database
record = database->GetRecordByID(0);
// get next field
fieldType = record->NextField(&fieldName, &size);
BREW API IDBRECORD_NextField | AEEDBFieldName | AEEDBFieldType
[ public ] SFCError Remove( SFBDBRecordSmpPtr record // SFBDBRecord Interface which needs to be removed );
Remove a record from the database
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database
record = database->GetRecordByID(0);
// remove the record, the record is also released
record->Remove(record);
[ public ] Void Reset(Void);
[ public ] SFCError Update( AEEDBField* fields // pointer to the new set of field values SInt32 fieldsCount // number of fields in the new set );
Update a record.
// create SFBDataMgr interface
SFBDBMgrSmp dbmgr = SFBDBMgr::NewInstance();
SFBDatabaseSmp database;
SFBDBRecordSmp record;
// create a field for record
AChar str[] = {"Update!!!"};
AEEDBField field = {AEEDB_FT_STRING, AEEDBFIELD_TEXT, STRLEN(str), str};
// open database
database = dbmgr->OpenDatabase("MyDataBase.db", true);
// get the record of specified index in database
record = database->GetRecordByID(0);
// update record
record->Update(&field, 1);
|
Copyright(c) 2002 - 2012 Sophia Cradle Incorporated All Rights Reserved. |
![]() ![]() ![]()
|