CFML Syntax Errors

Cold Fusion will report the template where the error occurred. It will also offer tips for debugging the error. When the template file cannot be completely parsed, the statment and the line number of the statement that contains the error is displayed along with a listing of Cold Fusion statements that come just before and after the error.
 
For example, the following error message would be received when a Cold Fusion variable did not have matching pound signs:
 
An error has occurred while processing the expression:
#coursenumber : #coursename# ( #courselevel#)
The error occurred on (or near) line 15 of the template file c:\cfscripts\ccat233\cf_syntax2.cfm.
7: Select coursenumber, coursename, courselevel from courselist
8:
9:
10:
11:
12:
13:
14:
15: #coursenumber : #coursename# ( #courselevel#)
The expression contains unmatched single quotes, double quotes, or pound signs.
 
Here are some common CFML syntax errors.
 
Error: An end tag is omitted or mismatched quotes
 
It is a common error to omit the end tag for CFQUERY, CFTABLE, CFOUTPUT, or CFIF. It is nearly as common to forget to close a quoted string. In both cases, Cold Fusion cannot completely parse the template file and so the same error message is used:
Cannot parse template file "C:\CFSCRIPTS\\CF_SYNTAX2.CFM"
The error is most likely caused by a missing or mistyped or tag.
 
Please, make sure that all and tags have matching ending tags.
 
Also, please make sure that all pounded symbols, e.g., #Variable#, as well as all single-quoted and double-quoted strings have their opening and closing characters matched.
 
To debug this type of error you must determine whether it is missing tags or missing quotes that are causing the problem by putting in order , , a double quote, a single quote, and a pound at the end of your template. When the error message changes or disappears, you have located the missing element that is causing the problem.
  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Related Articles

ColdFusion ODBC errors

There are two general classes of ODBC errors: 1) When ODBC attempts to connect to the datasource...

How To Unlock Microsoft Access Database Using Cold Fusion

There are two ways to accomplish this. First (and preferred) way is to run a dummy query:...