Board index » delphi » Paradox and autoinc issues

Paradox and autoinc issues

I have learned that experienced programmers who develop a
paradox based solution avoid autoinc fields. Problems are:

(1) The autoinc value isn't restored with a table repair causing
a key violation if the autoinc field was the PK.

(2) And the autoinc field prevents from backing up the data. If one
wanted to insert the backed up data into the table the autoinc
values cannot be inserted because these values are always
automatically created.

AFAIK there are two approaches:

(1) DBiDoRestruct the table converting autoinc to longint. Then
convert back and set the min value of the field to
MAX(autoinc_field)+1. OR patch the table header after the repair.

(2) Backing up the data shouldn't be a problem. In order to
restore do a DBiDoRestruct as in (1), insert all records and
convert back. Set min value or patch table header as in (1).

Does anyone have sample code for this? Are there any other
possibilities?

Werner

 

Re:Paradox and autoinc issues


On Tue, 08 Sep 1998 13:03:12 +0200, Werner Lehmann

Quote
<w...@bwl.uni-kiel.de> wrote:
>I have learned that experienced programmers who develop a
>paradox based solution avoid autoinc fields. Problems are:

>(1) The autoinc value isn't restored with a table repair causing
>a key violation if the autoinc field was the PK.

>(2) And the autoinc field prevents from backing up the data. If one
>wanted to insert the backed up data into the table the autoinc
>values cannot be inserted because these values are always
>automatically created.

>AFAIK there are two approaches:

>(1) DBiDoRestruct the table converting autoinc to longint. Then
>convert back and set the min value of the field to
>MAX(autoinc_field)+1. OR patch the table header after the repair.

>(2) Backing up the data shouldn't be a problem. In order to
>restore do a DBiDoRestruct as in (1), insert all records and
>convert back. Set min value or patch table header as in (1).

>Does anyone have sample code for this? Are there any other
>possibilities?

>Werner

Recent versions of TUtility don't mess up the autoinc fields like
earlier versions so this is no longer an issue. Also, if you back up
by copying all tables at once to a disk, tape, etc. then this also
should not be an issue since the links will be intact.

Regarding code for the first, you can do it right in the Database
Desktop manually. You would only need to code it if it was being done
frequently or needed to be done by the customer.

Steve F (Team B)

Re:Paradox and autoinc issues


Quote
Steve Fischkoff (TeamB) wrote:

> Recent versions of TUtility don't mess up the autoinc fields like
> earlier versions so this is no longer an issue. Also, if you back up

I've read about that. Unfortunately I cannot use recent BDE versions.
I must stay with the 16bit TUtility.

Quote
> by copying all tables at once to a disk, tape, etc. then this also
> should not be an issue since the links will be intact.

Of course. Only I don't want to do this for backup purposes but for
swapping. My customer wants to 'swap' the previous years.

Quote
> Regarding code for the first, you can do it right in the Database
> Desktop manually. You would only need to code it if it was being done
> frequently or needed to be done by the customer.

It SHOULD be done by the customer. I want to finish this job sometime.
I clearly don't want to get called for help in 5 years requiring me to drive
to the customer.

Werner

Re:Paradox and autoinc issues


Quote
>> Recent versions of TUtility don't mess up the autoinc fields like
>> earlier versions so this is no longer an issue. Also, if you back up

>I've read about that. Unfortunately I cannot use recent BDE versions.
>I must stay with the 16bit TUtility.

BDE 2.52 and the Tutilty version that corresponds to it does not reset
Autoincrement values

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads