> I want to get a record for a database, modify its contents, possibly size
> and the return it back to the database with the same index as before. For
> some reason, it didn't work. Here's a snippet that displays it:
>
>   Handle h, ho;
>   UInt i;
>   Err err;
>
>  i = USER_RECORD_START;
>  ho=NULL;
>  err = DmDetachRecord(UserDB, i, &h);                            // err = 0
> here
>  err = DmAttachRecord(UserDB, &i, h, &ho);                    // Crash!!!
>
> What is wrong?
>

How about answering your question with a question:

Why not just get the record (with DmGetRecord), modify its contents (by
locking it and then DmWriting to it, and unlockit it, resizing it with
DmResizeRecord, and then calling DmReleaseRecord when done.

That is, why the DmDetatch/DmAttach approach?

Neil

Reply via email to