Replace(Command1__m_id, "'", "''") 的问题
if(Request("newsID") <> "") then
Command1__m_id = Request("newsID")
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_news_STRING
Command1.CommandText = "DELETE FROM news WHERE n_ID in(" + Replace(Command1__m_id, "'", "''") + ") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
response.Redirect("news_list.asp")
else
response.write ("<script>alert('您没有选择任何记录!');history.go(-1);</script>")
end if
上段代码中,Replace(Command1__m_id, "'", "''") 这句单引号从何而来,Command1__m_id只是数字啊,没单引号啊?为什么要改成''
搜索更多相关主题的帖子:
Replace news response STRING