473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Archiving and autonumbers

I'm going to implement an archival database for my app. I have Table1
and Table2. Table2 is a duplicate structure of Table1. I appended
records with "ID between 1 and 100", then "ID between 300 and 400" then
"ID between 225 and 250". It appears they keep the same ID.

Is there anything I need to be concerned about when adding records from
one table to another table with an identical structure when using
autonumbers?
Oct 9 '07 #1
6 1671
Yes: there is the possiblity of duplicates.

If you delete the record with the ID of (say) 74 - placing it in your
archive table instead - it would be possible later to add another record
that uses the value 74. Typically this is done with an Append query that
specifies the value, but it could also occur if 74 was the last value in the
table, and you compacted after deleting. The problem arises when you try to
delete #74 again later: you can't add it to your archive table, as you
already have a 74 there.

If your database is split, you also run into the problem where executing an
append query resets the AutoNumber's Seed to a value that is too low, so you
can't add any more records. (This is not really a problem about the archive
table.) More info:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Salad" <oi*@vinegar.comwrote in message
news:13*************@corp.supernews.com...
I'm going to implement an archival database for my app. I have Table1 and
Table2. Table2 is a duplicate structure of Table1. I appended records
with "ID between 1 and 100", then "ID between 300 and 400" then "ID
between 225 and 250". It appears they keep the same ID.

Is there anything I need to be concerned about when adding records from
one table to another table with an identical structure when using
autonumbers?
Oct 9 '07 #2
Allen Browne wrote:
Yes: there is the possiblity of duplicates.

If you delete the record with the ID of (say) 74 - placing it in your
archive table instead - it would be possible later to add another record
that uses the value 74. Typically this is done with an Append query that
specifies the value, but it could also occur if 74 was the last value in
the table, and you compacted after deleting. The problem arises when you
try to delete #74 again later: you can't add it to your archive table,
as you already have a 74 there.
Hi Allen:

I have table Junk1 and Junk2. Junk 1/2 have the same structures. I
added to Junk2 the recs from Junk1 for autonumber 1-1000, 2000-3000,
1200-1300. That worked fine. Then I deleted ID 18 from Junk1 and ran
an append from Junk2 for ID 18 and junk1 got back the original record
OK. If I try to append 18 again into 2, and it now exists, it fails.

I think, since this is an archive, I won't have problems. The recs will
either exist in Junk1 or Junk2 but not in both. I'll append the recs
into Junk2 and delete them from Junk1....then I read below...
If your database is split, you also run into the problem where executing
an append query resets the AutoNumber's Seed to a value that is too low,
so you can't add any more records. (This is not really a problem about
the archive table.) More info:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html
That's good stuff, Allen. Would you recommend running your function on
the Archive database everytime prior to running the archive (yearly)
process? Or should it be run on both current/archives tables?
Oct 9 '07 #3
Salad <oi*@vinegar.comwrote:
>I'm going to implement an archival database for my app.
Why archive? Why not leave all the records in the database. And give the users some
means of doing date selections into the records. Or mark inactive customers as
inactive and leave them.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Oct 9 '07 #4
No: don't run the function unless you need it.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Salad" <oi*@vinegar.comwrote in message
news:13*************@corp.supernews.com...
Allen Browne wrote:

>If your database is split, you also run into the problem where executing
an append query resets the AutoNumber's Seed to a value that is too low,
so you can't add any more records. (This is not really a problem about
the archive table.) More info:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html
That's good stuff, Allen. Would you recommend running your function on
the Archive database everytime prior to running the archive (yearly)
process? Or should it be run on both current/archives tables?
Oct 9 '07 #5
Tony Toews [MVP] wrote:
Salad <oi*@vinegar.comwrote:

>>I'm going to implement an archival database for my app.


Why archive? Why not leave all the records in the database. And give the users some
means of doing date selections into the records. Or mark inactive customers as
inactive and leave them.

Tony
I've got records going back to 1996. And in my main form I present
counters on various tasks and issues in the company...about 35. So each
time the main form in activated it runs at least 35 SQL Selects and it
takes 3-4 seconds to refresh. I did a sample test of removing records
from 2003 and before and the form snaps to attention. No delay. If it
were simply marking customers inactive I wouldn't bother with archiving.
Also, were it not for the counters (a powerful representation of
what's going on) the need wouldn't be there either.

I doubt the need exists to even view a record prior to 2004. But if
there is the need, the user can simply select Archive and be working
with Archived records.

I've felt, over the years, the fastest a database app will ever be is
when it is brand new. More records, more processing, more delay.


Oct 10 '07 #6
Salad <oi*@vinegar.comwrote:
>Why archive? Why not leave all the records in the database. And give the users some
means of doing date selections into the records. Or mark inactive customers as
inactive and leave them.

Tony

I've got records going back to 1996. And in my main form I present
counters on various tasks and issues in the company...about 35. So each
time the main form in activated it runs at least 35 SQL Selects and it
takes 3-4 seconds to refresh.
Do have indexes on all the criteria fields? You likely do as 3 to 4 seconds over a
network is pretty decent for 35 queries.
>I did a sample test of removing records
from 2003 and before and the form snaps to attention. No delay. If it
were simply marking customers inactive I wouldn't bother with archiving.
Also, were it not for the counters (a powerful representation of
what's going on) the need wouldn't be there either.
So why not put an index on the date field of those records and pull in just records
belonging to the current or fiscal year?
>I doubt the need exists to even view a record prior to 2004.
Have you asked?
>But if
there is the need, the user can simply select Archive and be working
with Archived records.
Sure, but archiving is a PITA. As you add new fields and tables to the current MDB
you have to add them to the archive MDB. And you have to update your archiving
logic every time you run the archive just to ensure it's up to date.
>I've felt, over the years, the fastest a database app will ever be is
when it is brand new. More records, more processing, more delay.
Sure but ... <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Oct 12 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tim groulx | last post by:
Hello, Does anyone know of a way to schedule the archiving of analysis databases? Seems pretty lame if you can't... The only answer I've gotten is "maybe in Yukon".... Thanks.
2
by: Jim Andersen | last post by:
Hi there, After compacting/repairing a db, I was getting duplicate autonumbers. According to MS KB article http://support.microsoft.com/default.aspx?kbid=257408 This should be fixed with a...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
0
by: Zen | last post by:
Can I use "autonumbers" with this configuration? Access XP + Jet 4.0 SP8 1) In some circumstances Autonumber fields cannot correctly reseeded? 2) Or they are properly stable (like Jet 3.5...
5
by: SunSmile | last post by:
Hi, I am logging my exceptions to a word document(*.doc). After the size of word document is 5KB. I am archiving the word document to *.doc.1 Here when I am archiving the word document to...
4
by: Geoff | last post by:
I want to archive records from one recordset to another recordset. Not too sure of what to do in commented areas shown below. Dim Db As DAO.Database Dim Rec1 As DAO.Recordset 'Set as...
4
by: Paul H | last post by:
Could some one give me some pointers on basic archiving techniques? I have developed several databases but never been faced with this issue. Here is the basic scenario.. Suppose I have the...
2
by: Knokmans | last post by:
Hi, first, this concerns db2 v8 and v9 on AIX and Linux/intel Until now we used a "user exit" when we want to archive logfiles. We changed the user exit executable a bit so we receive an email...
3
bvdet
by: bvdet | last post by:
Following is an example that may provide a solution to you: """ Function makeArchive is a wrapper for the Python class zipfile.ZipFile 'fileList' is a list of file names - full path each name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.