SQL语义添加含'和"字符的字符串怎样添加到数据库中?
小弟在将数据添加到数据库的时候(用SQL语句),我用replace将其替换,但在输出的时候又需要转换成原字符,出现错误,代码如下:
Function HTMLencode(str)
dim msg
if str="" then
HTMLencode =""
exit Function
end if
msg = str
msg = replace(msg,chr(39),"\#39") '替换字符'
'msg = replace(msg,chr(34),"\#34") '替换字符"
HTMLencode =msg
End Function
Function Html(str)
dim msg
if str="" then
HTML =""
exit Function
end if
msg = str
'msg = replace(msg,"\#39",chr(39)) ' 还原
'msg = replace(msg,"\#34",chr(34))
Html = msg
End Function
请问高手错在哪,怎么解决?