当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个简单的网上书城的例子(一)

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 一个简单的网上书城的例子(一)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 60 ::
收藏到网摘: n/a

  数据库结构:
第一个库shopbag.mdb,两个表:
buyiformation表存客户信息如下:
Name,Tel,Address,ProductID,Quatity,Sum
第二个表products存商品信息:
CategoryID(商品分类号),productid,productname,descrition,
ischeck(用户是否选这一商品),price(单价)

下面试一个工具文件!util.asp

<%
Sub ListCategory( conn )

   Set rs = conn.Execute( "Category" )
   While Not rs.EOF
%>
 <A HREF=buy.asp?CategoryID=<%=rs("CategoryID")%>&Description=<%=Server.URLEncode(rs("Description"))%>>
<%=rs("Description")%>
</A> 
<%
      rs.MoveNext
   Wend
End Sub

Sub PutToShopBag( ProductID, ProductList )
   If Len(ProductList) = 0 Then
      ProductList = "'" & ProductID & "'"
   ElseIf InStr( ProductList, ProductID ) <= 0 Then
      ProductList = ProductList & ", '" & ProductID & "'"
   End If
End Sub

%>