Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Illegal characters????

Status
Not open for further replies.

streborr

IS-IT--Management
Jan 16, 2002
98
I have a submision form with a textarea which is sent to an Access db in a memo field.
It seems that almost all punctuations are illegal characters.
How can I allow these characters, including a carraige return, to be submitted to the db without generating an error?
If punctuation isn't used, the returned information looks like crap.

How does this forum allow me to add these characters to the message? - !'&quot;#{}[]`&$%()<>= plus a CR.

Thanks,
Rick
 
Server.HTMLEncode the strings

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
How do I use Server.HTMLEncode?

Here's the line I want to use it with.

<textarea name=&quot;message&quot; cols=&quot;50&quot; rows=&quot;8&quot; scrolling=&quot;no&quot; value =&quot;<%=Message%>&quot;></textarea>

thanks
 
[smile]

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
<textarea name=&quot;message&quot; cols=&quot;50&quot; rows=&quot;8&quot; scrolling=&quot;no&quot; value =&quot;<%=Message%>&quot;></textarea>


needs to be changed to

<textarea name=&quot;message&quot; cols=&quot;50&quot; rows=&quot;8&quot; scrolling=&quot;no&quot;><%=Message%></textarea>

Text areas are handled differently than text inputs
also when doing the update to the Access DB it's wise to pass the update directly to the DB instead of variable assignments, as in BlobField = Request.Form(&quot;message&quot;)
due to variable size limits and possible issues with the insert, plus dont forget about single and double quotes, those are extremely common oversights when passing a text input to an instert/update statement to a database cause an invalid string or statement.

side note, i dont know if access ever got this bug fixed, but if you need to see if the field is empty (memo field) if you do a If RS(&quot;message&quot;) <> &quot;&quot; then kinda of thing memo fields are always null, pass the value to a single dimention array ( that way you have little data size limitations) and you can check if there's contained in the field indirectly



Hope it helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top