我写的
<%
set rs20170627 = server.CreateObject ("adodb.recordset")
sql20170627="select top 12 * from Product order by ID desc"
rs20170627.open sql20170627,conn,1,1
if rs20170627.eof and rs20170627.bof then
Response.Write "栏目正在建设中……"
else
do while not rs20170627.eof
%>
<li>
<a href="productshow.asp?ID=<%=rs20170627("ID")%>" title="<%=rs20170627("Title")%>">
<img src="<%=rs20170627("DefaultPicUrl")%>" width="154" height="107" />
<span><%=strvalue(rs20170627("Title"),26)%></span>
</a>
</li>
<%
rs20170627.movenext
loop
rs20170627.close
set rs20170627=nothing
end if
%>
网上转载的
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<title>lovehui</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<%
dim conn,sql,rs
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("lovehui.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * From lovehui"
rs.Open sql,conn,1,1
do while not rs.EOF
response.Write"<br>"
for i=0 to rs.Fields.count-1
Response.Write rs.Fields(i).value
next
response.Write"<br>"
rs.MoveNext
loop
rs.Clone
set rs=nothing
conn.Close
set conn=nothing
%>
</html>