表:ruanjian 字段:filename leibie
代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-image: url(../img/beijing.gif);
margin-top: 0px;
}
-->
</style></head>
<body>
<div align="center">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../img/logo2.gif" width="780" height="50"></td>
</tr>
</table>
<%dim conn,db,rs,sql,ll,i
db="/mdb/login.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
sql="select * from ruanjian order by leibie'"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
ll=rs("leibie")
%>
<%do while not rs.eof%>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="128"><div align="right"><%=ll%></div></td>
<%sql="select * from ruanjian where leibie='"&ll&"'"%>
<%i=1%>
<%do while not rs.eof%>
<td width="652"><%=rs("filename")%>
<%i=i+1%>
<%if i mod 3=0 then%>
<br>
<%i=1%>
<%end if%>
<%rs.movenext%>
<%loop%>
</td>
</tr>
</table>
<%rs.movenext%>
<%loop%>
</div>
</body>
</html>
想要实现的效果:
a a.1 a.2 a.3
a.4 a.5 a.6
a.7 a.7 a.8
b b.1 b.2 b.3
b.4 b.5 b.6
..................
可是总是提示我
Microsoft JET Database Engine 错误 '80040e14'
字符串的语法错误 在查询表达式 'leibie'' 中。
/ruanjian/down.asp,行 29
29行为红字行
[此贴子已经被作者于2006-1-9 14:32:40编辑过]