首页 热点资讯 义务教育 高等教育 出国留学 考研考公
您的当前位置:首页正文

数据库技术在BREW中的应用

2020-11-09 来源:华拓网

欢迎进入IT技术社区论坛,与200万技术人员互动交流 >>进入 6、读取记录域 代码: boolean GetRecordByID(IDatabase * pIDatabase, uint16 u16RecID) { IDBRecord * pIDBRec1 = NULL; AEEDBFieldType fType; AEEDBFieldName fName; uint16 fLen; byte * data

欢迎进入IT技术社区论坛,与200万技术人员互动交流 >>进入

  6、读取记录域

  代码:

boolean GetRecordByID(IDatabase * pIDatabase, uint16 u16RecID)
{
IDBRecord * pIDBRec1 = NULL;
AEEDBFieldType fType;
AEEDBFieldName fName;
uint16 fLen;
byte * data = NULL;;

// This will reset the record Index to 0.
IDATABASE_Reset (pIDatabase);

// IDATABASE_GetRecordByID: returns a pointer to the record whose
// record ID is specified.
pIDBRec1 = IDATABASE_GetRecordByID (pIDatabase, u16RecID);

// Get the raw data of the field
for(;;)
{
// Get record 1 first field and display it
fType = IDBRECORD_NextField (pIDBRec1, &fName, &fLen);

data = IDBRECORD_GetField (pIDBRec1, &fName, &fType, &fLen);
if (data != NULL)
{
switch(fName)
{
case AEEDBFIELD_FIRSTNAME;
break;
case AEEDBFIELD_LASTNAME;
break;
case AEEDBFIELD_ADDRESS;
break;
default:
break;
}
}
else
{
break; //break for
}
}

// Now remove record 1.
IDBRECORD_Release(pIDBRec1);
return TRUE;
}

[1] [2] [3]

显示全文