asp 数据库 模块化 - 思路是没一个页面有一个自己的数据类 这里用nPath表示

<!--#include file="db_class.asp" -->
<%
'当前页面数据
nPath = "..\..\.."


't模块的数据
tMdb = "\newbox\nWork\mytest\m.mdb"

set db = new db_class
'db.conn_open(lib.dbPath)'打开数据库
db.conn_open(server.MapPath(nPath+tMdb))'打开数据库

'获得数据
set rs = db.getRsById(rs,"sysT",1)




%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<%=rs("mStr")%>
</body>
</html>
<%
db.conn_close()
%>

  

posted @ 2015-08-27 19:55  彭成刚  阅读(207)  评论(0编辑  收藏  举报