求朋友给看看,问题出在哪
下面这段代码读取数据库字段中汉字乱码,求朋友给看看,问题出在哪,给个解。
<%
dim dsn,conn
dsn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.MapPath("db.mdb")&""
on error resume next
set conn=server.CreateObject("adodb.connection")
conn.Open dsn
if err then
err.clear
set conn=nothing
response.write("<html><head><title>警告!发生常规性错误!</title></head><body style=""margin:0px;background-color:#eeeeee""><br><br><b><font size=4>警告:因为当前系统发现系统设置错误,导致不能连接到数据库!<br>请您检查/conn.asp文件第二行的数据库联接字符串是否正确<br><br>如果您不能解决此问题,请联系管理员来修正该问题</font><br></body></html>")
end if
sub closeconn() '系统事件:关闭数据库连接,节省服务器资源
conn.close
set conn=nothing
end sub
sub showmsg(msg)
response.write("<script language=javascript>alert('"&msg&"');</script>")
end sub
sub gotourl(url)
response.write("<script language=javascript>location.href='"&url&"';</script>")
end sub
sub back(num)
response.write("<script language=javascript>history.back("&num&");</script>")
end sub
sub closewindows()
response.write("<script language=javascript>window.close();</script>")
end sub
function filterstr(strChar)
if strChar="" then
filterstr=""
else
filterstr=replace(replace(replace(replace(replace(replace(replace(strChar,"'",""),"*",""),"?",""),"(",""),")",""),"<",""),".","")
end if
end function
%><%
Set rs=Server.CreateObject("ADODB.Recordset")
rs.open "Select * From tree order by orderID asc", Conn,1,1
%>
<html>
<head>
<title>系统栏目树的管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript" src="images/TreeView.js"></script>
<link href="images/Global.css" type="text/css" rel="stylesheet">
<style>
A.MzTreeview
{
font-size: 9pt;
padding-left: 3px;
}
</style>
</head>
<body class=frame>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.tree = new MzTreeView("tree");
tree.icons["property"] = "property.gif";
tree.icons["css"] = "collection.gif";
tree.icons["book"] = "book.gif";
tree.iconsExpand["book"] = "bookopen.gif"; //展开时对应的图片
tree.setIconPath("images/"); //可用相对路径,留空为当前路径
<%
Dim node
Dim reg : set reg = new RegExp : reg.global=True : reg.pattern=";"
Dim id, parentId, text, hint, icon, data, url, target, method
do while not rs.eof
'若是树的条目比较多的时候(比如大于1000)而又相对稳定的时候将这些数据生成