Troubleshooting Common Problems

The following section describes a few common problems that you might encounter and ways to resolve them.

ODBC data source configuration

Problem: ODBC driver manager cannot make a connection to the database.

Connection errors include problems with the location of files, network connections, and database client library configuration.

Verify that you can connect to the database by clicking the Verify button on the ODBC Data Sources page of the ColdFusion Administrator. If you are unable to make a simple connection from that page, you might need to consult your database administrator to help solve the problem.

Problem: Data source does not exist or name is incorrectly specified.

Create data sources before you refer to them in your application source files. Also, check the spelling of the data source name.

HTTP/URL

Problem: ColdFusion cannot correctly decode the contents of your form submission.

The method attribute in forms sent to the ColdFusion Server must be Post, for example:

<form action="test.cfm" method="Post">

Problem: The browser complains when you include spaces in URLs.

URLs cannot have embedded spaces. Use a plus sign (+) wherever you want to include a space. ColdFusion correctly translates the + sign into a space.

A common scenario in which this error occurs is when you dynamically generate your URL from database text fields that have embedded spaces. To avoid this problem, include only numeric values in the dynamically generated portion of URLs.

Or, you can use the URLEncodedFormat function, which automatically replaces spaces with + signs.

CFML syntax errors

Problem: You get an error message you do not understand.

Make sure all your CFML tags have matching end tags where appropriate. It is a common error to omit the end tag for the cfquery, cfoutput, cftable, or cfif tag.

When developing pages in ColdFusion Studio, use the Tag Completion feature, which adds an closing tag each time you create an opening tag.

Problem: Invalid attribute or value.

If you use an invalid attribute or attribute values, ColdFusion returns an error message. To prevent such syntax errors, use the ColdFusion syntax validation tools in ColdFusion Studio.

Problem: Mismatched quotes and escape characters.

Check strings in attributes and expressions for proper placement of single and double quotes. Color coding in ColdFusion Studio can help you spot improper quote placement.

Problem: You suspect that there are problems with the structure or contents of a complex data variable, such as a structure, array, query object, or WDDX-encoded variable.

Use the cfdump tag to generate a table-formatted display of the variable's structure and contents. For example, to dump a structure named relatives, use the following line. Note that you must surround the variable name with pound signs.

<cfdump var=#relatives#>



Banner.Novgorod.Ru