Hello,
As you all know, we type in messages for the message boards here and when we hit enter to the next line, the next line will be printed on the viewing board...or appostrophe's entered will show up without problems/errors.
Question:
Does anyone know how to make the returns/enters show in the display, and how to make it work even when the user uses appostrophe's...not to make the appostrophe's disappear, I still want them there...just don't want the error.
My Problem:
I created a message board for my site using the memo option in Access as the data type holder for the message that is left. However when a person will hit enter, it won't show the returns in the display. If they entered an appostrophe, then there is an error because the appostrophe conflicted with the sql statement and it won't get processed.
Example:
-----------page1.asp-------------
<form action='page2.asp' method='post'>
<textarea name='msg' width='30' height='20'></textarea>
<input type='submit' value='Submit'><input type='reset' value='Reset'>
</form>
-----------page2.asp-------------
<%
dim sql, message
message = request.form("msg"
sql = "INSERT INTO tbl_msgboard SET tbl_msgboard.message='" & message & "';"
' If syntax is wrong, is because I'm writing
' off the top of my head right now...think it's
' correct though
set conn = server.createobject("ADODB.Connection"
DSNtemp = "connection"
conn.Open DSNtemp
set rs = server.createobject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
conn.close
Set conn = nothing
response.redirect("pageView.asp"
%>
===================================
Now if there was an appostrophe entered in the message by the user, then this wouldn't finish and there would be an error.
Thank you for your time, and effort in advance!!
-Ovatvvon
As you all know, we type in messages for the message boards here and when we hit enter to the next line, the next line will be printed on the viewing board...or appostrophe's entered will show up without problems/errors.
Question:
Does anyone know how to make the returns/enters show in the display, and how to make it work even when the user uses appostrophe's...not to make the appostrophe's disappear, I still want them there...just don't want the error.
My Problem:
I created a message board for my site using the memo option in Access as the data type holder for the message that is left. However when a person will hit enter, it won't show the returns in the display. If they entered an appostrophe, then there is an error because the appostrophe conflicted with the sql statement and it won't get processed.
Example:
-----------page1.asp-------------
<form action='page2.asp' method='post'>
<textarea name='msg' width='30' height='20'></textarea>
<input type='submit' value='Submit'><input type='reset' value='Reset'>
</form>
-----------page2.asp-------------
<%
dim sql, message
message = request.form("msg"
sql = "INSERT INTO tbl_msgboard SET tbl_msgboard.message='" & message & "';"
' If syntax is wrong, is because I'm writing
' off the top of my head right now...think it's
' correct though
set conn = server.createobject("ADODB.Connection"
DSNtemp = "connection"
conn.Open DSNtemp
set rs = server.createobject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
conn.close
Set conn = nothing
response.redirect("pageView.asp"
%>
===================================
Now if there was an appostrophe entered in the message by the user, then this wouldn't finish and there would be an error.
Thank you for your time, and effort in advance!!
-Ovatvvon