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
Jose Diaz-Salcedo added
cfRssFeed
3 day(s) ago
Raymond Compton added
structBlend
23 day(s) ago
Duncan added
IsZIPUK
23 day(s) ago
Todd Sharp added
getTagContentAll
29 day(s) ago
Gerald Guido added
ListReturnDuplicat...
1 month(s) ago