asp + sql 为什么会插入乱码?怎么解决?
我用asp + sql 做了网页,为什么有的机子插入的是乱码?有的插入却是正常的值。为什么会出现这种情况?
<meta http-equiv="Content-Language" content="zh-cn">
<META http-equiv=content-type content=text/html;charset=gbk>
<%
'write search word 写入关键词
keywords=trim(request.QueryString("keywords"))
if keywords<>"" then
dim con
set con=server.createobject("adodb.connection")
con.open "driver={SQL Server};server=(local);uid=sa;pwd=xxxx;database=data"
set rst1=server.createobject("adodb.recordset")
sqlt="select * from search_word where f_class=8 and f_word='"& keywords &"'"
rst1.open sqlt,con,1,3
if rst1.eof then
rst1.addnew
rst1("f_word")=CheckStr(keywords)
rst1("f_class")=8
rst1("F_update")=now()
rst1("f_ip")=Request.ServerVariables("REMOTE_ADDR")
rst1.update
else
rst1("f_hits")=rst1("f_hits")+1 '搜索率
rst1("F_update")=now()
rst1("f_ip")=Request.ServerVariables("REMOTE_ADDR")
rst1.update
end if
rst1.close
end if
%>