<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
dim conn,rs
set conn = server.createobject("adodb.connection")
conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Jet OLEDB:Database Password=123;Data Source="&server.mapPath("getmblist.mdb") '; User Id=admin; Password=" '链接数据库
conn.open '将数据库打开
set rs = server.createobject("adodb.recordset")'创建一个记录表的实例指派给rs
rs.open "mblist", conn,1,1 '打开表
Response.CharSet = "GB2312"
%>
<%
do while not rs.eof
Response.write "bianhao:" & rs("bianhao") & "<br />"
Response.write "image:" & rs("image") & "<br />"
Response.write "mbid:" & rs("mbid") & "<br />"
Response.write "title:" & rs("title") & "<br />"
Response.write "utimes:" & rs("utimes") & "<br />"
Response.write "ltimes:" & rs("ltimes") & "<br />"
Response.write "<hr />"
rs.movenext
loop
Response.write request("username")
Response.write request("content")
%>
<%
rs.close '关闭表
set rs = nothing'销毁表对像
conn.close
set conn = nothing '销毁对像
%>
asp 连接access数据库
最新推荐文章于 2024-06-30 22:01:10 发布