473,396 Members | 2,010 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,396 software developers and data experts.

Set Counter to Zero

I have a database which I used for an individual project. I deleted all the
data in the tables and set out on the next project. I was well into this
project when I realised that the "counter" field which is an autonumber
started at 1106 as opposed to 1. If I do the same thing again (delete the
data from the tables) how do I reset the counter to 0?

Thanks and Regards
Nov 13 '05 #1
3 2219
On Mon, 28 Feb 2005 18:45:40 -0500, Brian Keanie wrote:
I have a database which I used for an individual project. I deleted all the
data in the tables and set out on the next project. I was well into this
project when I realised that the "counter" field which is an autonumber
started at 1106 as opposed to 1. If I do the same thing again (delete the
data from the tables) how do I reset the counter to 0?

Thanks and Regards


After deleting all the data, compact the database:
Tools + DataBase Utilities + Compact and repair

Be aware, however, that it really shouldn't matter what the AutoNumber
field number is, as long as it is unique (no duplicate numbers).

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

Instead of Delete use this

Truncate Table TableName

The counter will be reset to one

Madhivanan

Nov 13 '05 #3
Rog
Brian,

It is not considered good practice to use an autonumber for anything
else but a record key that the users can't see, so, as fredg said, it
really doesn't matter what the number is. If this is a number you use
to lookup records it's better to use a regular number field and add 1
every time a new record is created.

Nov 13 '05 #4

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

Similar topics

8
by: William Starr Moake | last post by:
I'm trying to script a download counter that will display the total number on the download page without server-side scripting. Below is my very incomplete beginning. It returns no errors, but...
8
by: Prometheus Research | last post by:
http://newyork.craigslist.org/eng/34043771.html We need a JavaScript component which will auto-submit a form after a set period has elapsed. The component must display a counter that dynamically...
11
by: OB1 | last post by:
I have seven computers. I have several web pages for the classes I teach at the local Community college. Some of my student complain to me that the counter on my web page is always at zero. On...
19
by: Arthur J. O'Dwyer | last post by:
Request for comments on the following program: http://www.contrib.andrew.cmu.edu/~ajo/workshop/tokens.c It's a token counter for the C programming language, following the outline...
7
by: Samir Patel | last post by:
Hi, I am developing C#.net web base application. I want to know how I can page count a same page. I want to this type. 1) When a new user open page he/she see the number of pages open same time...
0
by: Rusty Shackleford | last post by:
I am having trouble getting my ASP.Net applications and sessions to stay running. At first, I thought it was my lack of understanding of ASP.Net, or the fact that I am using Anonymous...
2
by: IloChab | last post by:
I'd like to implement an object that represents a circular counter, i.e. an integer that returns to zero when it goes over it's maxVal. This counter has a particular behavior in comparison: if I...
3
blackstormdragon
by: blackstormdragon | last post by:
Here were our instructions: "My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to...
30
by: Paul W Smith | last post by:
I have written a hit counter, which I believe counts the times my page is hit by a user for each unique session by the user. The relevant part of my code is below: If...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
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...

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.