高分急求ASP问题!!!!!!!!

jerrycool 2003-10-15 12:05:56
一个ACCESS数据库中有张books表,记录了N种书,有一个stock字段记录了每种书的库存,怎么用SQL查询并用recodeset打开在网页中显示books表中所有书的总库存?高分求购此题完整ASP源程序!
...全文
41 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hwkknd 2003-10-15
  • 打赏
  • 举报
回复
少了一个Next呵……
<%
rs.MoveNext
loop
%>
</table>
hwkknd 2003-10-15
  • 打赏
  • 举报
回复
<%
SQLStr="select B.name,S.SNum from Books B INNER JOIN stock S ON B.ID=S.ID"

……
……
rs.open Conn,SQLStr,1,3
%>

<table border="1" width="100%">
<tr>
<td width="50%">
<p align="center">书名</td>
<td width="50%">
<p align="center">数量</td>
</tr>
<%
do while Not rs.eof
%>
<tr>
<td width="50%"><%=rs("name")%></td>
<td width="50%"><%=rs("SNum")%> </td>
</tr>
<%
loop
%>
</table>
angelheavens 2003-10-15
  • 打赏
  • 举报
回复
sql="select count(stock) as totals from [books] group by book_typid"
set rs=conn.execute(sql)
if not rs.eof then
do while not rs.eof
response.write rs("totals")&"<br>"
rs.movenext
loop
end if
pimple 2003-10-15
  • 打赏
  • 举报
回复
你把表的结构和字段说一下,不要只说有两个表,它们之家必定有一个字段是相联系的.
laibagefei 2003-10-15
  • 打赏
  • 举报
回复
sql="select SUM(stock) as stock from books"
set Rs=conn.execute(sql)
偶来迟一步 :(
ratnight 2003-10-15
  • 打赏
  • 举报
回复
http://pcmemo.myetang.com/sql/
http://mugua.myrice.com/htm/sql_functions.htm
jerrycool 2003-10-15
  • 打赏
  • 举报
回复
这是刚才我老师说的,我试了下,行!谢谢各位:
sql2="select sum(stock) as stock from books"
<%= rs2("stock") %>
这个题主要是因为我不太会SQL的语法,哪位告诉我哪里有SQL语法教学的电子书下载或是教程,马上结!

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧