Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion 4.5 to MX cfupdate/cfinsert problems

Status
Not open for further replies.

Lotruth

Programmer
May 2, 2001
133
US
Here is the code...

<cfupdate datasource=&quot;A&quot; tablename=&quot;amendment&quot; formfields=&quot;amendmentid,amenderid,legalid,date,text&quot;>

and the other version...

<cfquery datasource=&quot;A&quot;>
update amendment
set amenderid=#amenderid#, legalid=#legalid#, date=#createodbcdate(date)#, text='#text#'
where amendmentid=#amendmentid#
</cfquery>

These both would work fine under 4.5, but when the form is submitted in MX to execute these, the browser says the page cannot be found. If I comment these out, then the page runs. Has anyone had this before?
 
Try taking out the date and text fields.. Might be reserved words causing your problem.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I had the same problem when I upgraded. Try adding the scope to the variables. Mine was a form. that needed added.

<cfquery datasource=&quot;A&quot;>
update amendment
set amenderid=#form.amenderid#, legalid=#lform.egalid#, date=#createodbcdate(date)#, text='#form.text#'
where amendmentid=#form.amendmentid#
</cfquery>

And I agree, I needed to add the scope because I was using something that was reserved, forget what is was now though.

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
So did you just give up on using cfupdate and cfinsert? Why won't these tags work correctly in MX?
 
Its apparently not that tags, its the fieldnames you're trying to use. Reserved words.. and is words that can't be uses asa variable or field names.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
In this case, it's most likely the &quot;reserved&quot; filed names, but as a general rule don't use <cfinsert> or <cfupdate> (ever), write you're own SQL Statements using <cfquery>. <cfinsert> and <cfupdate> are unstable, and have been know to break and cause problems for no reason.

Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Not only that but they don't really offer a lot of options... the sql to insert or update a row and a bit long winded but its worth it when you have perfect control of every aspect.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I agree. I am just being bullheaded because I did a lot of stuff using those tags in CF 4.5 and it worked fine. Just because we upgraded to MX, I have to go back and rewrite 5 years of code. Anyway, just the nature of the job I guess.
 
Man, I feel your pain...

You might be able to do some stuff with regex with like dreamweaver's find/replace tool and be able to replace those reserved words.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top