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

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

点击次数:37 次 发布日期:2008-11-22 11:25:52 作者:源代码网
源代码网推荐

源代码网整理以下数据库结构:
第一个库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

源代码网整理以下%>

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华