473,651 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access primary key reset problem

4 New Member
Hi to all..

The relationships in my database depend on autonumbered primary keys. Occasionally access will crash, causing all primary key values to be reset in tables. Now that the primary keys are rest, the table relationships are no longer valid.

Example:

For two tables, Suppliers, and Addresses

In Addresses the promary key is AddressID.

In suppliers I have a field AddressID. If access crashes the primary key index goes back to 1 in Addresses, and the Suppliers tables will refer to an AddressID with a no longer (or incorrect now) AddressID since all addressID's were reset.

Any suggestions? (other than making a backup of course)

I'm sure someone came across this before.

Thanks

Ilan
Mar 16 '08 #1
2 2696
nico5038
3,080 Recognized Expert Specialist
Strange, I've never experienced Access to change the data in tables when the database crashes.
What version of Access are you using ?
Is there no coding running when starting the database ?

Nic;o)
Mar 17 '08 #2
ilany
4 New Member
There is coding running when on startup, but I couldn't see how that would affect anything. The case is through, that primary key values have a potential to be reset, without my consent (or intentional consent). I'm using Access 2002.

Would acecss 2007 run my code with no problem? Or no editing?

Thank you
Mar 17 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3718
by: Graham Mattingley | last post by:
I have built a database with a Primary Key / Auto Increment. I have been doing loads of testing with adding and deleting records. Now I need to delete all of the test records, and put the database on a live website. Is there anyway to reset the Primary Key back to 1. Now when I have deleted all the records, the Primary Key uses the next number from when the records existed.
0
2724
by: Frances | last post by:
Hi All, I'm having a problem trying to add a record to a simple Access 2000 db (db is very similar to an address book but with more info than the usual address, phone, etc.). The database is one table, 36 fields. The record_id field is an autonumber field (long int) and primary key. The rest of the fields comprise of 30 text fields, 3 memo fields, 1 date field and 1 currency field. Text fields vary in number of characters allowed. ...
8
3983
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE( Pk_myPrimaryKey INTEGER CONSTRAINT pk PRIMARY KEY DESCRIPTION 'This is the primary key of the table',
4
6394
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
20
37879
by: TC | last post by:
I need an automated procedure to copy data from an Access table to a SQL Server table. Speed is important. What is the recommended technique? I can export the data from Access, copy it via FTP, then import it into SQL Server. I've tried that, and the speed is acceptable. It is an ugly solution, however, and I expect to find a better one -- preferably a solution better integrated with the Access RDBMS. I've tried using an ODBC...
2
2820
by: Hiyella2 | last post by:
Hello, I have a problem with a table in my MS Access 2003 table. The primary key of this table is an autonumber field set to a Long Integer, Yes - no duplicates. The autonumber made it to 10252. Now when I try to add a new record the autonumber started over at 1. Therefore I am getting an error message saying that it can't save this new record because it contains duplicate values. My best guess is that I need to reset the autonumber...
5
6083
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying to do this in my own time and then hopefully teach them how to do it. I have installed IIS on my machine and have followed a few web
3
7532
by: Rick Kay | last post by:
I have a table that has a Primary key and a foreign key. The primary key is NOT an Identity field, however, the foreign key is. I would like to know if there is a way to have the foreign key reset itself to the value of 1 when the Primary key changes. For example if I add the following 3 records to the table: 1st record - Primary key is 1, foreign key is 1; 2nd record - Primary key is 1, foreign key is 2; third record - Primary key is 2,...
2
8577
by: DerekF | last post by:
Reset the Identity Increment -------------------------------------------------------------------------------- Reset the Identity Increment Hello: I have a table with a bigint type column (field) that has an identity seed of 1 and an identity increment of 1. The column is the primary key for the table.
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.