|
 |
access_asp thread: Carriage returns in text\memo fields
Message #1 by "Peter Deakman" <peterd@e...> on Mon, 8 Oct 2001 13:26:49
|
|
I have to strip any carriage returns from memo fields before Inserting or
updating records in my Access data. I can do it with single quotes and
substitue a character that will not mess up the UPDATE or INSERT statement
but I cannot seem to figure out how to do it with carriage returns. I have
been trying versions of CHR(13) to get at it but no luck.
You consideration is very much appreciated
Message #2 by "Tony DiNucci" <tonydinucci@h...> on Tue, 9 Oct 2001 22:46:08
|
|
Add this function to your code and then call it when inserting/updating.
Hope this helps
Tony
<%
Function AddBreaks (GetTheStr)
for i = 1 to len(GetTheStr)
If len(GetTheStr) - i > 1 and mid(GetTheStr, i, 1) = chr(13) then
phrase = phrase & "<br>"
else
phrase = phrase & mid(GetTheStr, i, 1)
end if
next
AddBreaks = phrase
End Function
%>
> I have to strip any carriage returns from memo fields before Inserting
or
> updating records in my Access data. I can do it with single quotes and
> substitue a character that will not mess up the UPDATE or INSERT
statement
> but I cannot seem to figure out how to do it with carriage returns. I
have
> been trying versions of CHR(13) to get at it but no luck.
>
> You consideration is very much appreciated
Message #3 by "Jose Bueno" <jbueno@i...> on Thu, 11 Oct 2001 18:55:22
|
|
> I have to strip any carriage returns from memo fields before Inserting
or
> updating records in my Access data. I can do it with single quotes and
> substitue a character that will not mess up the UPDATE or INSERT
statement
> but I cannot seem to figure out how to do it with carriage returns. I
have
> been trying versions of CHR(13) to get at it but no luck.
>
> You consideration is very much appreciated
If you're using a textarea tag, try setting wrap to off.
|
|
 |