Ben Forta

Blog

March 2, 2001

Single Quotes and SQL Statements

Single quotes are used to delimit SQL strings, and so single quotes within SQL statements must therefore be escaped. Fortunately ColdFusion escapes single quotes for you when needed (for example, when a variable passed to contains a string containing a quote). But what when you don't want text...

March 1, 2001

Cleaning Most Recently Used Lists

ColdFusion Studio, like many Windows applications (and even Windows itself) keeps a list of recently used files for rapid reopening. But one often overlooked feature is the ability to clean up that list so that it only contains valid (still existing) files. To use this feature select File, Recent...

February 28, 2001

Create Your Own Templates

ColdFusion Studio comes with templates that can be used to jump-start page creation. These are accessed via the File, New option. Studio also allows you to create your own templates which are automatically added to the New Document dialog. To do this, simple open a new document, enter the code, and...

February 27, 2001

Renaming Illegally Named Columns

The SQL AS clause is used to provide aliases for columns or expressions. While primarily used to name calculated columns there is another important use - renaming illegally named table columns. To do this enclose the bad column name within single quotes, like this: SELECT 'user login' AS UserLogin....

February 26, 2001

Don't Mismatch Comments

HTML comments are formatted as , CFML comments are formatted as . The difference? The extra hyphen before and after the comment text. But what if you mismatched the comments (two hyphens on one side and three on the other)? You'll not throw an error, but code will not function properly - and...

February 25, 2001

Detecting Custom Tag Calls

ColdFusion 4 added support for sophisticated Custom Tags (tag pairs and nested tags), and the way a Custom Tag is called now varies based on the tag type - simple tags do all their processing at once, tag pairs do processing in various execution modes, and nested tags have to do much of their...

February 24, 2001

No Undo Restrictions

Depending on the exact version of ColdFusion Studio you are using, you might not be able to use the Undo feature to undo changes made before a file was saved. (This was the default at one point). Fortunately, you can (and should) change this - select Settings from the Options menu, click on Editor,...

February 23, 2001

Determining the File Being Executed

CFML provides two functions for determining the name of the CFM file being executed. GetCurrentTemplatePath() returns the name of the current CFM file, and so does GetBaseTemplatePath(). The difference? If these functions are used within an included file GetCurrentTemplatePath() returns the name of...

February 22, 2001

Accessing Stored Procedure Return Codes

Many DBMS' allow stored procedures to return result codes - indicators, counters, status codes, and more. To retrieve these values use to execute the stored procedure instead of , and make sure to set RETURNCODE="YES" (the default is "NO"). The result code will then be accessible as...

February 21, 2001

Creating Persistent FTP Connections

can be used to perform server-side FTP operations - get, put, delete, rename, and more. operations are usually performed in a single request, but connections can be maintained across requests if needed. To do this simply create the FTP connection within a persistent scope, for example the SESSION...

Page 473 of 489 (4890 posts)