views:

39

answers:

1

Hi,

I guess the following line of code looks familiar to many...
[^A-Za-z0-9]
And what I'd like to do is to keep a block of "text", alphnumeric as stated above and plus punctuations and other special characters that sql for MS Access can handle, also, the special character of # sign would be replaced with ## (a double of it to escape a single #) for the underlying scripting language I'm using (Railo). So, to sum up, I'd like to remove any character that Access and Railo can't handle prior to writing the string into a db table.

The above alphnumeric is a start. Can you help to make it complete?

Thanks.

+2  A: 

Railo can handle every character that I'm aware of. Not sure what the author of the question is implying. The pound character is the only character that I'm aware of that needs to be escaped. If the user used the proper <cfqueryparam> correctly, he should be able to insert just about anything he wants in Access.

webRat
Either `"` or `'` also needs escaping, if entering string directly into value attribute, i.e. `<cfqueryparam value="..."/>` or `<cfqueryparam value='...'/>`. But if using a variable then nothing needs escaping at the queryparam level, can just do `<cfqueryparam value="#VarName#"/>`
Peter Boughton