用asp调用数据库中的数据,请帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/25 16:20:03
图片在access数据库的products表里,
id(图片序号),anclassid(图片分类),productname(图片名称),pic(图片路径)

图片分类在access数据库的sort表里,
anclassid(类别序号),anclass(类别名称),anclassidorder(类别显示时排列顺序),

我的问题是,打开products.asp图片列表页的时候,不管什么类别的图片都是混在一起的,我想要在这个页面显示图片分类的名字,点进去可以单独查看每个类别,这段代码,请帮我改一下:

现在我想要查看图片分类,只能手动写在静态页上面:
products.asp?id=big&anclassid=类别序号

如果这个页面上自动调用类别,我就不用每次都修改文件了。

<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<%
if anclassid="" then
set rsok=server.createobject("ADODB.recordset")
sqlok="select * from sort order by anclassidorder"
rsok.open sqlok,conn,1,1
do while not rsok.eof
%>
<tr height="25">
<td width="13%"> </td>
<td w

<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<%
if anclassid="" then
set rsok=server.createobject("ADODB.recordset")
sqlok="select * from sort order by anclassidorder"
rsok.open sqlok,conn,1,1
do while not rsok.eof
%>
<tr height="25">
<td width="13%"> </td>
<td width="83%" style="border-bottom:1px solid #CCCCCC " align="center">
<b>【<a href="products.asp?id=big&anclassid=<%=rsok("anclassid")%>"><%=rsok("anclassname")%></a>】</b></td>
<td width="4%"> </td>
</tr>
<%rsok.movenext
loop
rsok.close
set rsok=nothing
else%>
<tr height="25">
<td width="