Re: Renumbering MS db ID?

From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 08:13:56 -0500

On Sun, 15 Aug 2004 16:31:02 GMT, Mr. B <User@NoWhere.com> wrote:

¤ I have a small MS db which I update daily with new info. I've noticed that
¤ the ID numbers are increasing sequentially. How can I reset them back to 1
¤ when I purge my data prior to adding in the new stuff?
¤
¤ Here is how I'm currently deleting the info from my db (TSUpdate):
¤
¤
¤ Private Sub ClearMyData()
¤ ' Open Connection and Clear Data
¤ OleDbConnection1.Open()
¤ Dim MyCommand As New OleDbCommand("DELETE FROM TSUpdate",
¤ OleDbConnection1)
¤ MyCommand.ExecuteNonQuery()
¤ OleDbConnection1.Close()
¤ MyCommand.Dispose()
¤ End Sub
¤
¤
¤ Thanks in advance!

See the following MS KB article:

How to reset an AutoNumber field value in Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;812718

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)



Relevant Pages

  • Re: Renumbering MS db ID?
    ... when I purge my data prior to adding in the new stuff? ... Private Sub ClearMyData() ... Dim MyCommand As New OleDbCommand("DELETE FROM TSUpdate", ... How to reset an AutoNumber field value in Access ...
    (microsoft.public.data.ado)
  • Re: Renumbering MS db ID?
    ... when I purge my data prior to adding in the new stuff? ... Private Sub ClearMyData() ... Dim MyCommand As New OleDbCommand("DELETE FROM TSUpdate", ... How to reset an AutoNumber field value in Access ...
    (microsoft.public.dotnet.framework.adonet)
  • Renumbering MS db ID?
    ... How can I reset them back to 1 ... when I purge my data prior to adding in the new stuff? ... End Sub ... Bruce ...
    (microsoft.public.dotnet.framework.adonet)
  • Renumbering MS db ID?
    ... How can I reset them back to 1 ... when I purge my data prior to adding in the new stuff? ... End Sub ... Bruce ...
    (microsoft.public.vb.database.ado)
  • Renumbering MS db ID?
    ... How can I reset them back to 1 ... when I purge my data prior to adding in the new stuff? ... End Sub ... Bruce ...
    (microsoft.public.data.ado)