473,385 Members | 1,798 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,385 software developers and data experts.

How to reset a Key field password

6
I have a database with a lot of table relationships set and need to reset the main table's (ConceptID which is an auto numberand a Key field ). Is there a way to reset the ConceptID without removing all the relationships then altering the table field then reset all the relationships?
I tried this code but wasn't able to do it because of relationship.
Alter table [Concept]Alter Column [Conceptid]Counter(4000); When i run this i get the error message:
"Cannot change field 'ConceptID'. It is part of one or more relationships. Also, currently there are no records in any of the tables.
Jan 27 '14 #1
3 1293
zmbd
5,501 Expert Mod 4TB
Leno01: If you don't mind me asking; why?
Also, I just about deleted this thread based on the title:
"Key field password " in that it reads as if you are asking for a password (which doesn't appear to be the case).

The entire point of the autonumber is that it is never repeated, ever and that it is not suposed to be really used for anything meaningfull. For example, in the lab, there are lot numbers, these are non-repeating and sequential; however, I do not use these as the primary key because the lot numbering system might (and has) changed. Each record has the autonumber assigned as the primary key and it is this primary key that I have linked. Let them change the lot numbers all they want, I still have a fool proof tracking on the records.
  • Backup your database.
  • Open the table you wish to reset, delete all records. As this is in a relationship, all records in all other tables that depend on this one will have to have all of the related records deleted as well or you risk data orphans.
  • Close the table
  • Make a copy of your table that you wish to "reset"
  • Open only the copy in design view
  • Change the autonumber to numeric(long)
  • Save
  • Open/change the copy in/to normal view
  • In the newly changed field enter the value of 0 leave remaining fields empty. There should be no other records.
  • Save and Close the copy
  • Using the wizard create a simple select query on the copy
  • Save and run - it should only have the one record
  • Switch to design view for the query
  • Change the query to an "Append" query selecting the original table to append to.
  • Run the append query
  • Open your original table and delete the "0" record.
  • Your next new record will start with "1" in the autonumber field.
Jan 27 '14 #2
Leno01
6
I am using the auto number as a key field. however, I was in development and need to start the autonumbers at a specific autonumber for a type of tracking i am doing.
I know it doesn't make sense but a lot of things in our life done and we have to work around them.
Thank you so much for the work around - it certainly beats having to remove all the relationship and add them back.

I dont know who to tell but maybe you can pass this on.
I have tried a lot of access help sites and none of them can lite a candle to this site.
Thanks again
Jan 27 '14 #3
zmbd
5,501 Expert Mod 4TB
Glad I could help.

Found this technique some, oh, well, ages ago in a textbook for ACC1997 I think... been way too many moons, beers, and kids (^_^)

The Site Admins, other Moderators, and Experts will be along shortly... it's always nice to have positive feedback.
Jan 27 '14 #4

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

Similar topics

2
by: N. Graves | last post by:
Hey is there a command like in SQL Transactional that will reset the Autonumber field to the highest number in the found in the field? I developing a access database with a several table that...
2
by: eddie | last post by:
Hi Guys, We've lost the password for the sa. No other users belong to the admin group. I've tried logging in using osql -E (windows authentication) without success. Is there anyway to reset the sa...
12
by: Lile | last post by:
Hello ! I have a problem: I started a new PC, with Windows XP Pro. The first time, it asked me to define the language for region options, language, and keyboard. It offered me corespodentlly :...
8
by: apking | last post by:
Hi how to reset Md5 password in php?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.