Hi Régis, greetings from Rio,
Well, since my first old days of PalmOS C programming, I do not assign
strings to the structs like you're doing:
/*Now, I'm changing the struct content...*/
theStructure.CodRca="8";
theStructure.NomeRca="Regis Daniel";
theStructure.Senha="saf";
I usually do this:
StrCopy(theStructure.CodRca, "8");
StrCopy(theStructure.NomeRca, "Regis Daniel");
StrCopy(theStructure.Senha, "saf");
And, specifically in your case, I guess your record is Packed, that is, all
the fields are written one behind another. Like this:
"8\0RegisDaniel\0saf\0"
And you could not use the
StructType *s;
StructType theStructure;
h = DmGetRecord(dbPtrF, 0);
s= (StructType *)MemHandleLock(h);
Approach. You should unpack the record before copy it to the struct and
modify the struct. You could always write the record in a unpacked way, and
then just make a locked pointer to it and DmWriteString what you wanna do.
E-mail me in private (well, you can write in portuguese to me too) and I can
tell you some simpler samples of how to write records in database.
Actually I only write XML strings to my records, as they're easier to
manipulate since you do have some basic set of XML functions.
Basically the
DmWrite(s, 0, &theStructure, sizeof(theStructure));
function is bad too. Sizeof(thestructure) will return the size of
3*sizeof(char*), witch willl currupt your DmWriting.
That is: You're a bit lost with database programming for PalmOS. You must
first understand how it works and how does the C struct works, before
writing it.
Again: e-mail me in PVT and I can send to you some code samples.
Cheers !
-- J. Machado
-- [EMAIL PROTECTED]
PS: I guess this is a double POST... My mail server is playing with me
today :( Sorry people !
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/