Retrive Autonumber

Results 1 to 3 of 3

Thread: Retrive Autonumber

  1. #1
    Yngvar Guest

    Default Retrive Autonumber

    If you use SQL to add a new record to a table and the index field is of the type autonumber. What is the easiest way to get that number, after you&#039ve added the new record.

  2. #2
    Join Date
    Dec 1969

    Default RE: Retrive Autonumber

    After your insert do...<BR><BR>Select max(column_name)<BR>From table_name<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default NO...

    If two people enter data at the same exact time what happens you end up getting the second persons Id. It rarely happens but does. Ive had experience with this before. What I ended up doing was using an adOpenKeySet cursor with an adLockOptimistic lockType.<BR><BR>After you do<BR>rs.update<BR>you should be able to receive the key. let us know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts