John,
It still doesnot work ..
I am created the PDB using PDB converter. Is it causing problem
because of the format ? I am able to get the first field of the
structure. But not others ??
Do you have sample program for reading db records field wise .. ??
Pls let me know how to go about this ..
Thx,
Andy
On 1/25/06, John Jenusaitis <[EMAIL PROTECTED]> wrote:
> you can do something like this, and cast the record directly to your
> record type. that way you can access the data using the structure.
>
> MyRecord * record;
> Char * code;
> Char * name;
>
> record = (MyRecord *)MemHandleLock( recordH );
>
> code = record->code; //this will return a Char * to code
> name = record->name; //this will return a Char * to name
>
> John
>
> Anand Kale wrote:
> > Hi,
> >
> > We are trying to read Palm DB records and then trying to access the
> > data from each column of the record using offsetof. But we get only
> > the data from first column of the record. How to get the data from
> > remaining columns ? Also we need to get data in temporary data
> > structures and not directly in the form using FldSetText ..
> >
> > Here's small snippet,
> >
> > struct MyRecord {
> >
> > char code[20];
> > char name[40];
> >
> > };
> >
> > MyRecord *record;
> >
> > /// Reading from database a record
> > recordH = DmQueryRecord ..
> >
> > record = MemHandleLock(recordH);
> > // p1 is void *ptr malloced
> >
> > Memcpy(p1, record+offsetof(MyRecord, name), StrLen(name)+1);
> >
> > But we are not able to get the name value into p1 ..
> >
> > Please let us know how to use offsetof or if there is another way to
> > do that in Palm API.
> >
> > Andy
> >
>
> --
> For information on using the PalmSource Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
>
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/