B
bbell1980
I can do this in vb.net but I can not do it in this asp code.
the user is writing what ever text into a text box and posting it to a
access database. problem is when they use words such as (we'll, can't,
shouldn't,) it will not go in because of the single quote mark.
I am trying to replace any single quote mark with the HTML code
"‚"
so I recoded the .asp script and now get this error
**********************************************************
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/admin/news_add_action.asp, line 8
*********************************************************
here is the code I've been using:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open sDSN
dim thenews
thenews.text = Request.form("newsbody")
dim singlequote
singlequote = Replace(singlequote, "Chr(39)", "‚")
sSQL = "INSERT INTO news(newsTitle, newsBody, newsDate) values('" &
Request.Form("newsTitle") & "','" & singlequote & "',#" & Date() &
"#)"
response.write sSQL
objConn.Execute(sSQL)
Response.Redirect "news.asp"
objConn.Close
Set objConn = NOTHING
%>
the user is writing what ever text into a text box and posting it to a
access database. problem is when they use words such as (we'll, can't,
shouldn't,) it will not go in because of the single quote mark.
I am trying to replace any single quote mark with the HTML code
"‚"
so I recoded the .asp script and now get this error
**********************************************************
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/admin/news_add_action.asp, line 8
*********************************************************
here is the code I've been using:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open sDSN
dim thenews
thenews.text = Request.form("newsbody")
dim singlequote
singlequote = Replace(singlequote, "Chr(39)", "‚")
sSQL = "INSERT INTO news(newsTitle, newsBody, newsDate) values('" &
Request.Form("newsTitle") & "','" & singlequote & "',#" & Date() &
"#)"
response.write sSQL
objConn.Execute(sSQL)
Response.Redirect "news.asp"
objConn.Close
Set objConn = NOTHING
%>