[thelist] TIP: Getting Autonumber Value in Access 97 and lower

Warden, Matt mwarden at odyssey-design.com
Mon Jun 19 16:58:48 2000


Well, call me crazy here, but isn't there a chance that the ID returned
really isn't the ID you want? Is it:

a. gaurenteed that the highest PK number is the last-entered?
b. gaurenteed that the two sql statements are executed one-after-another

b is what worries me. I'm thinkng that it could be *possible* for the first
to be executed, then a SQL statement from another script, then your max(id)
statement.

(just being me)
--
mattwarden
mattwarden.com

> performance killer, using the recordset to do the updating. Seriously. try
> this:
>
> Update WC_Basket set col=value where....
> Select max(recid) as RecordID from WC_Basket
>
> you can even throw them in the same db call:
>
> Set oRS = dbConn.Execute "Update WC_Basket set col=value where....;Select
> max(recid) as RecordID from WC_Basket"
>
> and then get to the recordid like--
>
> Set oRS = oRS.NextRecordSet
> recid = oRS(0)
>
> (just being my ole pedantic performance worried self)
> sgd