There is a built in method of getting that last records primarykey for most
databases, but not for MSACCESS.
You need to get the MAX() number to do that, and u should do it in a locked
transaction block so that you don't get the ID of another record  that has
been added since.
Or, get the max() id, +1, turn off auto increment, and insert with explicit
ID.


Regards
--
Russ Michaels
my blog: http://russ.michaels.me.uk/
www.cfmldeveloper.com - free CFML hosting for developers
skype: russmichaels




-----Original Message-----
From: Leigh [mailto:[email protected]] 
Sent: 24 September 2010 17:38
To: cf-talk
Subject: Re: cfinsert/cfupdate


> Can you do that by running it inside cftransaction?

I remember seeing something similar in old threads about retrieving an
Autonumber value for an Access database. I have not really thought it
through, but I suppose in theory it might work.  Though it does seem like
stretching the intent of transactions a bit.

I just wanted to confirm there was not a built-in option I was overlooking.
Though it is certainly possible to implement your own handling (ie uuid
column, etcetera...) having it done 'auto-magically', like with cfquery,
would be preferable.

-Leigh



      



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337505
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to