Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 6th, 2009, 02:58 PM
BDevil15 BDevil15 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 26 BDevil15 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 57 m 5 sec
Reputation Power: 0
General - Deleting Data from Database

I know Ive seen this before and did do a search but didnt have any luck so sorry for the repeat.

But I have been playing with a database and finally have it about where I need it, functionally. But in the process of learning I have put in tons of records in multiple tables and was wondering if theres a way to wipe all the data from my db so that all records autonumbers begin with 1 again but leaving the tables and format of the db alone.

Thanks,

Reply With Quote
  #2  
Old November 6th, 2009, 03:18 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,885 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 1 Day 1 h 15 m 11 sec
Reputation Power: 562
To delete all records from a table, just run a Delete Query with no criteria. But that won't reset Autonumbers to 1. That's somewhat difficult to do, and I'd have to research how to do so. But the real question is, Why would you want to? The purpose of an Autonumber is to serve to assure that there can be no duplicates in a primary key field. The value is totally meaningless, and it's good practice to never even display such ID numbers to users. So there's really no valid reason to try to reset Autonumbers. If you are using Autonumbers for human reference, and anyone cares about what the numbers are, you're not using them for what they are designed for.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
  #3  
Old November 6th, 2009, 03:37 PM
Sneakz Sneakz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 90 Sneakz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 2 sec
Reputation Power: 1
I've found that after deleteing all data from my tables, when I do a compact and repair on the database, autonumber will start from 1 again.

To delete the data I personally just open up the database window, open the table, select everything and delete manually... Then again I don't have THAT many tables to do it too so a delete like don suggests might be quicker if you have many tables.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > General - Deleting Data from Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek