Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Proper coding for insert

9 views
Skip to first unread message

pbl...@odstrategies.org

unread,
Dec 28, 2009, 11:15:05 AM12/28/09
to
This is a great approach for adding data ABC style. If you design the
DCT properly you can also get many fields populated based on the DCT
defined Initial value. Child records can be primed with a parent Key
value automatically if you set the Initial value in the DCT. It's code
you never need to write done for you any place a PRIMERECORD is
called.

It works even better if you use single field LONG AutoInc primary key
on all the tables too. Making a meaningless single field primary key
allows you to sort out the complexities of duplicates after the fact.

For adding parent / children nest the child inserts in a loop of
parent inserts. Now the parent fields are in scope when you prime the
children. It's code you can't make a typo when you write. Your DCT
does all the complex code that is easy to mess up.

On 28 Dec 2009 09:56:39 -0500, Edvard Korsb�k <Edvard uden for meget
spam at bb-soft dot dk> wrote:

>PRIMERECORD() handles all the difficult with inserting records.
>I use each and every time
>ACCESS:FILE.PrimeRecord()
>....Set values
>IF ACCESS:FILE.Tryinsert() <> level:Benign
> ACCESS:FILE.CanCelAutoInc()
>END
>
>Has never faile me.
---------------------------------------
Paul Blais - Hayes, Virginia

0 new messages