Hi David,

I sent another response that is kind of long-winded.  I think the one from
Laurence, below, gets to the point quicker.  However, the examples in my
response might help make it clearer if needed.

The reason for this message however, is simply to suggest that you try
removing the single quotes from inside the column value (not the enlosing
quotes) and see if you can then insert the row with the full length of text.
This will very quickly confirm whether the long text can be inserted and
whether the single quotes are a problem.  Once this is confirmed it should
be a lot easier finding the solution since you can zero in on the real root
of the problem.

Phill



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Laurence Middleton
Sent: May 14, 2002 1:59 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFTALKTor] Memo fields


Hi, David.

I think there was confusion in the original thread yesterday about the use
of PreserveSingleQuotes(). You need to preserve single quotes in SQL code,
but you DON'T NEED to preserve single quotes in the text you're inserting:
you need to ESCAPE them (which CFQUERY does for you).

Example:

<cfset myMemoText = "Here's text with David's single quotes.">
<cfset myWhereClause= "WHERE firstName = 'David'">

<cfquery name="testquery2" datasource="#db#" dbtype="ODBC">
        UPDATE MyTestTable
        SET myMemoField = '#myMemoText#'
        #PreserveSingleQuotes(myWhereClause)#
</cfquery>

Hope this comes soon enough to be of some help.

Of course, the suggestions in the thread which recommended encoding your
text before storing it will catch not just the single quotes but also text
which may have SQL in it. That's a whole other security discussion.

As to the 255 character limit for Memo fields, I have never encountered this
in earlier versions of Access -- are you sure it's not an artifact of the
other problem with text that contains single quotes? Is the Access field
defined as type "Memo" rather than "Text" (which can be at most 255
characters)?

 -- Laurence

Laurence Middleton
code wrangler
ecentricarts inc.
[EMAIL PROTECTED]
416 644-5000 ext.225

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Dave Boehm
Sent: Tuesday, May 14, 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: [CFTALKTor] Memo fields


Has anyone ever been able to use a memo field. I can't save anything that
has more than 255 characters to an Access 2000 database from  ColdFusion
4.5. I posted a similar question yesterday with no usable response.  My long
text buffer size is set to the default 64k.

David Boehm
M&T Printing Group
907 Frederick St.
Kitchener, ON
N2B 2B9
(519) 571-0101
[EMAIL PROTECTED]

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Laurence Middleton"
<[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)


-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Phill Addorisio" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to