Discussion:
recording text with line breaks
(too old to reply)
webmobile
2005-09-23 16:21:54 UTC
Permalink
I'm trying to insert/update a VFP8 Table memo field with text posted from a
HTML form (text area).
The code I'm using is this:

sql="UPDATE DATA2!personefisiche SET memo=[" & trim(Request.Form("memo")) &
"] where codice=" & request.form("utente")"
conn.Execute sql, recordsaffected

It works perfectly with plain text but it don't work if I insert a line
break in text.
The query is not recognized even that looks well.
Any idea?

Thanks
paolo
Lee Mitchell
2005-09-23 20:50:47 UTC
Permalink
Hi paolo:

Are you placing the data in a memo binary field or a memo filed? I would
use a memo binary field type.


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by webmobile
I'm trying to insert/update a VFP8 Table memo field with text posted from a
HTML form (text area).
sql="UPDATE DATA2!personefisiche SET memo=[" & trim(Request.Form("memo")) &
"] where codice=" & request.form("utente")"
conn.Execute sql, recordsaffected
It works perfectly with plain text but it don't work if I insert a line
break in text.
The query is not recognized even that looks well.
Any idea?
Thanks
paolo
webmobile
2005-09-26 15:37:19 UTC
Permalink
Hi Lee,
I'm using a clasic memo field, but the problem is not in the field but in
the query.
the error is this:

Microsoft OLE DB Provider for Visual FoxPro error '80040e14'
Command contains unrecognized phrase/keyword.
/rapporti/memo.asp, line 28

The line mentioned is the one that executes the query:

<% sql=UPDATE DATA2!personefisiche SET memo=[test test] where codice=11
conn.Execute sql, recordsaffected %> (this is line 28)

The memo value is a text. The text is in effect "Test "+Line break
(chr(13))+"Test"

If there is not line break the query is valid, if there is a line break the
error fires.

I can bypass the problem using a function that substiutes chr(13) with <br>
but I need a clean memo field and not a memo field with code.
Any sugegstion?
Paolo
Are you placing the data in a memo binary field or a memo filed? I would
use a memo binary field type.
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by webmobile
I'm trying to insert/update a VFP8 Table memo field with text posted from a
HTML form (text area).
sql="UPDATE DATA2!personefisiche SET memo=[" & trim(Request.Form("memo"))
&
Post by webmobile
"] where codice=" & request.form("utente")"
conn.Execute sql, recordsaffected
It works perfectly with plain text but it don't work if I insert a line
break in text.
The query is not recognized even that looks well.
Any idea?
Thanks
paolo
Loading...