🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #2038

Problem Archiving Ttable with AutoInc Field

#2038
From: Allan Knox
Date: Sun, 04 Apr 1999 00:00
29 lines
2478 bytes
I have a program suite that includes the facility to archive older records
in selected tables when the database grows too large to backup onto a single
zipped floppy (or whatever number of floppies the user accepts as
convenient).    As the same routine is accessed for all the tables, I have
resorted to the use of Fields to transfer those records that meet the
criteria (that is, older than the set date, and with all action complete).
The original code iterated fieldIndex from 0 to fieldCount -1 and used
                        ArchiveTbl.Fields[fieldIndex] :=
sourceTbl.Fields[fieldIndex]
There has been no problem with the facility running under Versions 2 or 3.
However, I upgraded to Version 4.02 (and BDE 5.01) and immediately hit a
compiler problem because it would not allow the above at all.   I though I
had overcome the situation by adding .Value to both sides.   Certainly that
compiled, and it appeared to work.   However, when I ran the code using one
of the tables which included a TAutoInc field, it refused to play because it
would not allow writing a pre-set value to the archive AutoInc field.   I
considered abandoning the AutoInc and replacing it with an integer at
source.   However, the options there are less robust than the guaranteed
uniqueness of the AutoInc, and I would need to restructure a pile of
historical tables spread over several clients.   The only other option I can
see is to change the structures of the Archive table and associated Work
Table (from which the source table is re-created after successful archiving)
to make the autoInc an Integer.   However, that seems a bit inelegant, and I
suspect I will have difficulty in recreating the truncated source file after
the archive and associated backup has successfully completed.
 Does anyone have an obvious solution I have missed, or a better way ahead
than outlined above?
Thanks in Advance
Allan Knox
Technical Details
Message-ID: <7e7ct8$53l$1@plutonium.btinternet.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 115d96,3cb3d85d7a5e7a3f,start
X-Google-Attributes: gid115d96,public
From: "Allan Knox" <CCC@BTinternet.com>
Subject: Problem Archiving Ttable with AutoInc Field
Date: 1999/04/04
Message-ID: <7e7ct8$53l$1@plutonium.btinternet.com>
X-Deja-AN: 462515793
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Organization: Cowal Computing Consultancy
X-MSMail-Priority: Normal
Reply-To: "Allan Knox" <CCC@BTinternet.com>
Newsgroups: borland.public.delphi.database