|
-
Apr 1st, 2001, 03:08 PM
#1
Thread Starter
Junior Member
asp record....URGENTTTTTTTTTTTTTTTTT
I enter a record in a table. How do I get the id of that record if the id is an autonumber?
Code pleazz....
Last edited by loverpal; Apr 1st, 2001 at 03:39 PM.
-
Apr 1st, 2001, 04:21 PM
#2
Addicted Member
Im assuming by autonumber, you mean Access... The only way (I know) is to do a "SELECT id FROM table ORDER BY id DESC", and then move to the first record, that would be the last record you inserted. If you have a high volume of users, that split second select could get corrupted by another insert. I've never seen that happen, but that's not to say it can't
SQL Server has a @@IDENTITY "function" that essentially does the exact same thing - it echoes the last primary key inserted into a table.
-
Apr 1st, 2001, 05:33 PM
#3
Guru
here's some a link to some code for you, its in VB so you'll just need to convert it to VBScript
http://www.vbforums.com/showthread.p...threadid=50949
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|