一个简单的网上书城的例子(一)
发布时间:2006-10-14 2:58:15   收集提供:gaoqian
数据库结构:
第一个库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

%>

 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50