This is actually pretty easy in ACCESS:

1) put the enire transaction within a CFLOCK block

2) do the insert

3) then select max(id) assuming you have an autonumber field for the id

Which will give you the id of the record just inserted.

This is so easy that even I can do it.

Rick Colman

-----Original Message-----
From: Protoculture [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 31, 2005 7:10 AM
To: CF-Talk
Subject: grabbing the id of a newly created item..

How would I modify an insert query to grab the id ( autonum, primary key )
of the item that I just inserted?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192368
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to