Hello,
    4104 seems like the fileStream record length. Check with filez that the
first 4 bytes of each record are 'DBLK' and the next 4 bytes
0x0001000 (size). If so it a fileStream db and settings the stream attribute
dmHdrAttrStream with DmSetDatabaseInfo should make the db
readable by the fileStream api.
    Doing custom reading as Logan wrote should be also fairly easy.

Regards,
    Miro Pomsar

----- Original Message ----- 
From: "Logan Shaw" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Friday, April 01, 2005 06:17
Subject: Re: Help ! Create record db from filestream db


> Michael wrote:
> > Regarding to the third party support, it said the transfer file is
> > "plain" files not for PDB files because it
> > writes the data on a "stream" to Palm memory, not as a "Palm Database".
>
> This makes it sound like the data is NOT in a database.
>
> > And I work with CASL that has function can read file and it work
> > well. I use PDBingo and FileZ check the pdb and I can view the records
> > but with the rec size 4104 bytes(4k) and no attribute sets.
>
> This makes it sound like the data IS in a database.
>
> I will assume that the data IS in a database, but it's not a File
> Stream database.  I will assume that the data is split up with
> each PDB record containing a 4096-byte block, so that if you had
> 10,000 bytes in this "stream", you would have this:
>
> record number contents
> ------------- --------
> 0 bytes 0 - 4095
> 1 bytes 4096 - 8191
> 2 bytes 8192 - 9999
>
> Is that an accurate description?
>
> If so, then you can just modify your struct and your callback to
> read directly out of the PDB instead of treating it as File Stream.
> Use DmFindDatabase() and DmOpenDatabase() to open the database.
> Put four things into your struct:
>
> typedef struct
> {
>     DmOpenRef openRef;
>     UInt16 recordCount;
>     UInt16 recordIndex;
>     UInt16 offsetInCurrentRecord;
> } YourStruct;
>
> Then, in the callback, use DmQueryRecord(), MemHandleLock(),
> MemHandleUnlock(), and DmReleaseRecord() to fill the buffer.
>
> When you do the DmQueryRecord(), you get a handle back.
> You can use MemHandleSize() on that handle and compare
> it to offsetInCurrentRecord to know whether to move on to
> the next record or fill the buffer from current one.
>
>    - Logan
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


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

Reply via email to