> When one does an insert of a string into an Access database
> with CF5, does one have to get rid of commas in the string?
>
> In other words, can one insert a string like:
>
> "Hello, my name is Bob."  with a regular Insert Into SQL
> command, or are commas like single quotes?

First off - did you try it to see what happened? If not, why not? You
should have a test database that you can mess about with, especially
when you're still learning.

Anyways - commas are just like any other character when inside a string
- the important thing would be the quotes.

To guarantee that the string is inserted properly, use CFQUERYPARAM
inside the CFQUERY and ColdFusion will handle any special characters

So:
<CFQUERY DATASOURCE="myDSN" NAME="InsertData">
   insert into myTable (myField)
   values (<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#myString#">)
</CFQUERY>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to