数据库结构:
第一个库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
%>
时间: 2024-11-06 19:42:44