Home > Database > Mysql Tutorial > 数据库技术在BREW中的应用

数据库技术在BREW中的应用

WBOY
Release: 2016-06-07 15:17:14
Original
1105 people have browsed it

欢迎进入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] 

数据库技术在BREW中的应用

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template