I don't see what's wrong. I only have one question for you. Did you
open your database in read-only mode? If you did, you'll get a fatal
error when you try to create a new record.
On Thu, 12 Oct 2000 22:12:39 -0400, "Sean L. Gilley"
<[EMAIL PROTECTED]> wrote:
>
>
>I have a program with the following code. This code only executes
>the first time this version of the program is run. After that, since
>the records are created, the code is skipped. The problem is that
>the first time the program accesses the newly created record, it
>gives a fatal error: "Err getting rec". Once this happens, the
>program works correctly.
>
>Since it seems to be related to the upgrade stuff, here's the code
>that does the upgrade. Am I doing something wrong?
>
> if(totitems < 16) {
> for(i = totitems; i < 16; i++) {
> recnum = i;
> record = DmNewRecord(gDB, &recnum, sizeof(Balance));
> if(!record) {
> dAlert("ERROR: CB.1");
> break;
> }
> bal_H = MemHandleLock(record);
> bal.abalance = (Long)INITBALAMOUNT;
> DmWrite(bal_H, 0, &bal, sizeof(Balance));
> MemHandleUnlock(record);
> DmReleaseRecord(gDB, recnum, true);
> }
> }
>
>Sean.
>
>---
>Sean L. Gilley If the people are buying tears
>614-860-0247 (h) I'll be rich someday.
>[EMAIL PROTECTED]
>
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/