如何使用JavaScript来写ASP程序
2005-01-24 10:29:34 来源:WEB开发网核心提示:<%@Language="javaScript" %> <% function OpenDB(dbname) { var connstr = "PRovider=Microsoft.Jet.OLEDB.4.0; Data Source="+Server.MapP
<%@Language="javaScript" %>
<%
function OpenDB(dbname)
{
var connstr = "PRovider=Microsoft.Jet.OLEDB.4.0; Data Source="+Server.MapPath(dbname);
var conn = Server.CreateObject("ADODB.Connection");
conn.Open(connstr);
return conn;
}
var sResult = new Array();
var oConn = OpenDB("Data/Data.mdb");
//特殊字符:+,%,&,=,?等的传输解决办法.客户端字符是经过escape编码的
//所以服务器端先要经过unescape解码.
//Update:2004-6-1 12:22
var sql = "select SortName From Article_Sort order by OrderID";
var rs = oConn.Execute(sql);
while(!rs.EOF)
{
//unescape解决中文处理的问题.
Response.Write(unescape(rs("SortName").Value + "<BR>"));
rs.MoveNext();
}
%>
<%
function OpenDB(dbname)
{
var connstr = "PRovider=Microsoft.Jet.OLEDB.4.0; Data Source="+Server.MapPath(dbname);
var conn = Server.CreateObject("ADODB.Connection");
conn.Open(connstr);
return conn;
}
var sResult = new Array();
var oConn = OpenDB("Data/Data.mdb");
//特殊字符:+,%,&,=,?等的传输解决办法.客户端字符是经过escape编码的
//所以服务器端先要经过unescape解码.
//Update:2004-6-1 12:22
var sql = "select SortName From Article_Sort order by OrderID";
var rs = oConn.Execute(sql);
while(!rs.EOF)
{
//unescape解决中文处理的问题.
Response.Write(unescape(rs("SortName").Value + "<BR>"));
rs.MoveNext();
}
%>
Tags:如何 使用 JavaScript
编辑录入:爽爽 [复制链接] [打 印][]
更多精彩
赞助商链接