It will wait for the DB to unlock. 

You might prefer these options though:

Either:

<cfquery name="addMe" datasource="#APPLICATION.DSN#">
INSERT INTO myTable
(something) 
VALUES 
('#FORM.something#');
SELECT SCOPE_IDENTITY() AS new_id;
</cfquery>

<!--- Set the new id for use with calling page and potentially with update 
statement --->
      <cfset new_id = '#addme.new_id#'>


or this:

<cfquery name="addMe" datasource="#APPLICATION.DSN#">
INSERT INTO myTable
(something) 
VALUES 
('#FORM.something#')
</cfquery>

<cfquery name="getLastAdd" datasource="#APPLICATION.DSN#">
SELECT @@identity as new_id 
</cfquery>
<cfset new_id = '#getLastAdd.new_id#'>

I'm not sure if access supports two statments in the same query so you might 
have to go with the second option. Also, I know access supports the @@identity 
function but I'm not sure if it supports SCOPE_IDENTITY().

You may wish to cflock or cftransaction the second option if you need to go 
that route.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 beta – Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283668
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to