Hi All,

I created a stream database and tried to read from it as below which i cuddo
successfully.But my dbt is this the only way to read data from any
database(stream/record)databases on palm.

I went like this..
 
par c -a stream e:\svr.pdb svr data STRT e:\svr.mp3


CDatabase dBase(0,"svr",0,0,dmModeReadOnly);
UInt32 records=dBase.NumRecords();
CRecord recD(&dBase);  

///again wrote back to the another stream as cudnot find a function for
creating large chunks of memory???
 FileHand fstrmHandle=FileOpen(0,"svrStream",0,0,fileModeReadWrite,&err);

 //char* dataBuffer=(char*)MemPtrNew(330000);//crash out & link errors..

 MemHandle MemRcrdHandle;
 UInt32 rcrdSize;
 char *pData; 

 UInt32 nBytesWritten=0;
 int nfPosition=0;

 
 for(int rcrdNo=0;rcrdNo<records;rcrdNo++)
 {
    recD.GetRecord(rcrdNo);  ///Get the indexed Record
    rcrdSize=recD.GetRecordSize(); //Get the RecordSize
    MemRcrdHandle=dBase.QueryRecord(rcrdNo);//Get the MemHandle for the
Record
    pData= (char*)MemHandleLock(MemRcrdHandle); ///Get the pointer to the
RecordData
   // FileSeek(fstrmHandle,nfPosition,fileOriginCurrent); //Seek to the
currentpoistion
    nBytesWritten=FileWrite(fstrmHandle,pData,1,rcrdSize,&err);//Write the
byte data to the stream     
    //nfPosition=rcrdSize+1;  //Skip the position.
 }
 

Now my dbt is this the only way to read the data from any kind of
database.Is there any other way for reading the data from the filestream
database using the filestream api.(even though it is filestream databse it
does have the record structure(viewed using the database viewer of the
simultor,actually the 320kb file got divided into 81 records(4kb size)).

So i think i am clear now.I just want to read the data from a stream
database continuosly with out using this records n all(just as i do in a
normal C progrm).Is this possible??

2)
I cudnot use this MemPtrNew for allocating memory of 320kb size.I cudnot
find the MemGluePtrNew.I cud find the palmGlue libraray and the include
files but no file contains this function.Shud i dowonload file containing
this function.

r there any other functions for allocating large chunks of data(like upto
320kb r even some MB data(which usually mp3 files r of!!)

Thanx a lot, 

Best Regards
Anil

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to