On 1/25/01, Paul's Mail penned:
>I am inserting data from various sources into an Access table using SQL
>Insert Into statement and having a problem with the insert stopping when it
>reaches a '#name#' with a hyphen in it eg O'Conner.
>The hyphen is taken as enclosing the text field and so causes the statement
>to report a syntax fault.
>Is there any simple work around this besides banning O'Conners etc?
>
>Paul Burgess

I've done a bunch of database applications, and have never had this 
problem. I assume you're not using the preservesinglequotes() 
function. If you are, try without it as that will CAUSE an error on 
inserting and updating. Also, if you have debugging turned on, take a 
look at what it's trying to insert. It should look like:

customer_name = 'Bob O''Conner'

Note that CF (at least 4.01 and up, not sure about before that) will 
automatically escape the single quotes in SQL statements and let you 
insert and update with no problem.  The preservesinglequotes() 
function is really for SELECT statements so when searching for 
O'Conner, it won't be resolved to O''Conner, although it seems to 
return the same records for me whether I use it or not.

Can we see your INSERT statement?
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to