AccessPatternMatchingFormat(string)
Last updated August 14, 2002
Version: 2 | Requires: ColdFusion 5 | Library: StrLib
Description:
A visitor may enter wildcard characters into a search string without realising. An invalid search string can then produce either a database error or odd results. This is a particular problem with double-byte languages like Japanese where a [ for example may be hidden inside a character.
Return Values:
Returns a string.
Example:
"98.3%" becomes "#AccessPatternMatchingFormat("98.3%")#"
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| string | The string to format. | Yes |
Full UDF Source:
<cfscript>
/**
* Strip pattern-matching wildcards from a string appearing in an Access query.
* Modded list order (rkc 8/14/02)
*
* @param string The string to format. (Required)
* @return Returns a string.
* @author Matthew Walker (matthew@cabbagetree.co.nz)
* @version 2, August 14, 2002
*/
function AccessPatternMatchingFormat(string) {
return ReplaceList(string, "[,%,_,##", "[[],[%],[_],[##]");
}
</cfscript>
Search CFLib.org
Latest Additions
Shawn Porter added
DeMoronize
3 hour(s) ago
Chris Carey added
readPropertiesFi...
1 day(s) ago
Randy Johnson added
lastDayofWeek
3 day(s) ago
Frank Marion added
sitemapPing
7 day(s) ago
Top Rated
QuickSort
Rated 5.0, 3 time(s)
indentXml
Rated 5.0, 3 time(s)
queryColumnsToSt...
Rated 5.0, 3 time(s)
generateSsccAsn
Rated 5.0, 3 time(s)