asp读取数据库中的html标签数据
数据库my.mdbidaabb1<html><head><html><head><metahttp-equiv="Content-Type"content="text/h...
数据库my.mdb
id aa bb
1 <html> <head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>id</td>
<td>aa</td>
<td>bb</td>
</tr>
</table>
</body>
</html> 展开
id aa bb
1 <html> <head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>id</td>
<td>aa</td>
<td>bb</td>
</tr>
</table>
</body>
</html> 展开
1个回答
展开全部
<%
dim conn,connstr,rs
connstr="DBQ="+server.mappath("dir.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" '数据库连接地址
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
Sql="select from table order by id desc"
Set rs=Server.CreateObject("adodb.recordSet")
rs.open sql,conn,3,2
if rs.eof then
else
do while not rs.eof
%>
<td><%=rs("id")%></td>
<td><%=rs("aa")%></td>
<td><%=rs("bb">%></td>
<%
rs.movenext
loop
rs.close
end if
%>
</tr>
</table>
</body>
</html>
dim conn,connstr,rs
connstr="DBQ="+server.mappath("dir.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" '数据库连接地址
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
Sql="select from table order by id desc"
Set rs=Server.CreateObject("adodb.recordSet")
rs.open sql,conn,3,2
if rs.eof then
else
do while not rs.eof
%>
<td><%=rs("id")%></td>
<td><%=rs("aa")%></td>
<td><%=rs("bb">%></td>
<%
rs.movenext
loop
rs.close
end if
%>
</tr>
</table>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询