[thelist] TIP: Getting Autonumber Value in Access 97 and
lower
Steve Cook
sck at biljettpoolen.se
Mon Jun 19 02:42:07 2000
Hey Matt,
I sent out a tip about JUST this problem late last week - whassup? Don't
you read every mail I send :-)
Here's the body of the tip, with tip tags removed so it doesn't catalogue
twice :-)
You can find the value of an auto-incrementing field after creating a new
record in asp by using the following;
intID = RS.Fields("ID")
before you close the recordset. Warning! It only works with certain
combinations of cursor type, lock type and depends on whether the field
you're looking at is indexed. The most common combinations are:
Indexed - yes (some servers handle un-indexed values)
Cursor Type - Keyset (or all, Keyset will always work, but you can try others)
Lock Type - Pessimistic / Optimistic
for Access 97, the following combinations apply:
Driver: ODBC - Indexed : Yes, Cursor Type: Keyset, Lock Type : Pess/Opt
Driver: Jet 4.0 - Indexed : Yes, Cursor Type: All, Lock Type : All
The Wrox book Professional Active Server Pages 3.0 gives the complete list,
but the above table covers all the Access 97 combos.
Hope this helps.
.steve
http://wapwarp.com
http://cookstour.org
http://www.wap-dev.org