not able to read the DataBase | developer.brewmp.com not able to read the DataBase | developer.brewmp.com

Developer

not able to read the DataBase

Forums:

Hi al,

m working on DB(database).I have successfully created a DB n have added some data to it....

Now i want to read the DB, which m not able to do :-(

I hav written a piece of code, for the same....it is as below.

// "msg_draft" is the name of my applet
void Show_DB(msg_draft * pMe)
{
uint32 record_count;
IDBRecord * pIDBRecord;
uint32 i = 1;
AECHAR * DB_data = (AECHAR *)MALLOC(100 * sizeof(AECHAR));

char * temp_buff = (char *)MALLOC(100*2 * sizeof(char));

DBGPRINTF("************ Start **************");

// "pszFile" is the DB file created
// "record_count" holds the number of records in the "pszFile"

pMe->pIDatabase = IDBMGR_OpenDatabase(pMe->pIDBMgr,pszFile,TRUE);
record_count = IDATABASE_GetRecordCount(pMe->pIDatabase);

if(! record_count){
DBGPRINTF("****** FAILURE in Getting Record count*****");
return;
}

DBGPRINTF("****** No of records in DB=%d *******",record_count);

pIDBRecord = IDATABASE_GetNextRecord(pMe->pIDatabase);

// DB_data = IDBRECORD_GetField( pIDBRecord,pDBFields[0].fName, pDBFields[0].fType,pDBFields[0].wDataLen);

DB_data = IDBRECORD_GetFieldString(pIDBRecord );

SETAEERECT(&pMe->rect,0,0,pMe->DeviceInfo.cxScreen,pMe->DeviceInfo.cyScreen);

IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);

DBGPRINTF("****** After CLEAR-SCREEN *******");

IDISPLAY_DrawText(pMe->a.m_pIDisplay,AEE_FONT_BOLD,DB_data, \
-1,50,50,&pMe->rect,IDF_ALIGN_CENTER);

IDISPLAY_Update(pMe->a.m_pIDisplay);

FREEIF(temp_buff);
FREEIF(DB_data);

DBGPRINTF("************ End **************");

return;

The program runs fine with no errors, but shows Blank Screen on the Simulator....
can ne 1 tell me wat is wrong....

Please suggest ne thing which u thing can help in this case( to fetch record frm DB)

thanx in advance,

Priya