I have changed to the ToDoDB and it reads the records out of there fine and
writes them out to a file. Is there something that one needs to know about
creating databases using CodeWarrior 6 Lite as far as the record structure
goes? The record should consist of a series of bytes since I am using the
DmWrite( precord, offset, pfield, StrLen( pfield ) );
method. So shouldn't I be able to just do a byte read against this record
somehow?
The record from the textcond.java example is type MemoRecord. MemoRecord
has a _getBytes method.
I have used the syntax from the _getBytes method
byteOut = new ByteArrayOutputStream();
dataOut = new DataOutputStream(byteOut);
rec.writeData(dataOut);
data1Out.write(byteOut.toByteArray(), 0, (byteOut.size() - 1));
dataOut.flush();
dataOut.close();
So I am using the following to get the bytes.
// Loop over all records
for (i = 0; i < count; i++) {
// Recond a record
rec.setIndex(i);
SyncManager.readRecordByIndex(db, rec);
// Print it out to file
byteOut = new ByteArrayOutputStream();
dataOut = new DataOutputStream(byteOut);
rec.writeData(dataOut);
data1Out.write(byteOut.toByteArray(), 0, (byteOut.size() - 1));
dataOut.flush();
dataOut.close();
}
Is there a better way?
Please advise
Dean-O
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard
Burmeister
Sent: Monday, June 11, 2001 11:43 AM
To: Palm Developer Forum
Subject: RE: How does one read through a Palm Database?
> From: Rochester, Dean
>
> I have gone through the examples in the CDK for the conduits
> and all works great. I am now trying to modify the
> textcond.java example to read through a different database
> then the MemoDB.
>
> I have changed the remote database using CondCfg.exe but when
> I look at the output file that it makes on my PC I do not see
> the text for the record data. I only see the following...
> The memo filed does not contain what is shown in the list below.
> Do I have to use a different type of record? I am
> using the MemoRecord as per what is in the textcond.java file.
>
I may be misunderstanding your problem, but it seems worthwhile pointing out
that each database on a Palm OS device can contain whatever its author wants
to put in it. The only major limitation is that each record can contain no
more than 64KB of stuff (actually, a tiny bit less). The structure of each
record in a database can be anything. So, there is absolutely no reason to
assume that the record structure used by the other database is anything at
all like the structure of the MemoDB. In fact, it would be very surprising
if the structure was the same, unless the other db was just a copy of the
memo db.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/