用类似以下的程序来写:
dim conn
dim rsconn
set conn=server.createobject("adodb.connection")
conn.open dsn,uid,pwd
set rsconn=conn.execute(SQL语句)
conn.close
另一种方法
function changechr(str)
changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"")," "," ")
end function
OR
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "")
fString = Replace(fString, CHR(10), "")
HTMLEncode2 = fString
end function
在存进数据库时
比如:
rs("文章内容")=HTMLEncode2(request("msg"))
rs.update