Hi Will,
There are two real possibilities:
1) stick with autonumbering. Wrap your insert and a SELECT Max(ID) inside a
single CFTRANSACTION. Vaguely ugly.
2) Create your own Primary Key.
2a) Create your own incremental ID from a separate table. Needs
CFTANSACTION.
2b) Create an incremental key by first selecting the current Max ID. (see the
FuseBox tag MaxID for this) Needs CFTRANSACTION.
2c) Create your own random key. Use CF's built-in uuid function, or make your
own with randrange, dates, etc, in combination. Excellent if you deal with
several replicas which are merged from time to time.
Personally, I use CF_MaxID and CFTRANSACTION.
Best of luck,
Lee Bjork Borkman
Bjork.Net - ColdFusion Tags by Bjork
"W Luke" <[EMAIL PROTECTED]> wrote:
Hi,
I'm inserting a load of data into a Table of an Access Database. The ID
field is generated by AutoNumber.
As soon as the record has been inserted, I need to output what that ID was.
How can I do this?
Cheers
Will...
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.