Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert memo text
Message
From
08/03/2008 05:52:39
 
 
To
07/03/2008 12:49:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01299781
Message ID:
01299919
Views:
12
>Thanks Sergey.
>When translated into my real life situation
>
>  execstr = "EXEC 'insert into memos (link_table,record_id,memo_name,memo_text,added_by)"
>  execstr = execstr & " values ([people],"
>  execstr = execstr & lcPerson_id & ","
>  execstr = execstr & "[notes],"
>  execstr = execstr & "CHRTRAN([" & request.form("txtNotes") & "], CHR(13) + CHR(10), []),"
>  execstr = execstr & "[" & session("FullUserName") & "])'"
>  response.write(execstr)
>  oConn.EXECUTE(execstr)
>
>It doesn't work. Probably the SQL handler can't deal with the CHRTRAN function. And besides, I would want to preserve the CRLF in the saved text. I could maybe preclean the request.form("txtNotes") with a VB function before putting it into the execstr but still I would want to save the original format of the text.
>Any other ideas?
>
>'''''''''''''''''''''''''''''''''''
>>
>>insert into mytable (memofield) values (CHRTRAN(memotext, CHR(13) + CHR(10), ""))
>>
>>>When using the SQL INSERT command, how do you "clean" a memo field if there are carriage returns in the memo text?
>>>
>
>

Try without the EXEC. e.g:
.oConn.Execute("INSERT INTO mytable (memofield) VALUES ('This is '+CHR(13)+CHR(10)+'a test')")
Previous
Reply
Map
View

Click here to load this message in the networking platform