Getting back to the OP. I can totally see the how using cfinsert and
cfupdate are attractive options for RAD

I use Steve Bryant's DataMgr quite a bit during development and prototyping.
http://datamgr.riaforge.org/

I actually use a service layer but the end result is that I can use one line
of code for simple update and insert queries using the contents of a form
post.
<cfset application.databaseservice.runmethod(upsert,"myTable", form)>

Which is not all the different than using cfupdate/cfinsert.

So if you are in get 'er done development mode you don't have to worry about
making changes to your queries or regenerating your database CFC's every
time you make a change to the database. I just reload the datamgr CFC and I
am good to go. This can shave quite a bit off development time when
prototyping.

When things stabilize and we are getting ready to go into production I can
massage my queries, create stored procedures or even swap out my entire
database layer to use ORM, Illudium CFC's or what ever and the rest of my
app is none the wiser.

So as an option that does not require cfinsert and cfupdate and maintains
brevity and speed of coding you can use a service layer as a front end to
your favorite/preferred database abstraction layer to accomplish the same
thing.

Tastes great AND less filling.

FWEIW,
G!




On Fri, Sep 24, 2010 at 12:46 PM, Russ Michaels <r...@michaels.me.uk> wrote:

>
> 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:cfsearch...@yahoo.com]
> 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:337507
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to