当前位置: 首页 > 图文教程 > 网络编程 > ASP > 制作我们自己的Ebay(拍卖系统)(4)

ASP
用ASP实现对Web搜索引擎Index Server的访问
ASP.NET数据库应用指南
利用ASP存取各种常用类型数据库(1)
利用ASP存取各种常用类型数据库(2)
利用ASP存取各种常用类型数据库(3)
利用ASP存取各种常用类型数据库(4)
利用ASP存取各种常用类型数据库(5)
利用ASP存取各种常用类型数据库(6)
一个简单的网上书城的例子(一)
一个简单的网上书城的例子(二)
一个简单的网上书城的例子(三)
一个简单的网上书城的例子(四)
一个简单的网上书城的例子(五)
一个简单的网上书城的例子(六)
一个简单的网上书城的例子(七)
一个简单的网上书城的例子(八)
用asp怎样编写文档搜索页面(1)
用asp怎样编写文档搜索页面(2)
用asp怎样编写文档搜索页面(3)
用asp怎样编写文档搜索页面(4)

ASP 中的 制作我们自己的Ebay(拍卖系统)(4)


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

  First, we'll discuss the easy part. You'll have to create a few forms - one for the users to register (that is, get themselves into our AuctionUsers table), and one for sellers to post their info. These forms should be easy to create if you know how to handle forms (check out this WDVL article for more information). Basically, you should collect all the information from the forms and update the appropriate tables:



'Set variables and create object
strConnectionString = "DSN=MyAuction;UID=username;PWD=password;Database=MyAuctionDB"
set rst = Server.CreateObject("ADODB.Recordset")


'Insert info into auction table
strSQL = "INSERT INTO tblAuctions (StartDate, EndDate, SellerID)
VALUES ('" & Request.Form("StartDate") & "', '" & Request.Form("EndDate")
& "', " & SellerID & ")"


rst.open strSQL, strConnectionString


'Get the ID of the auction we just entered
strSQL = "SELECT max(AID) as AID FROM tblAuctions"
rst.open strSQL, strConnectionString
intAID = rst(0)
rst.close


'Insert item info
strSQL = "INSERT INTO tblAuctionItems (AID, Name, Description, " & _
"MinPrice, Increment, Available)" & _
"VALUES (" & intAID & ", '" & Request.Form("ItemName") & _
"', '" & Request.Form("ItemDescription") & "', '" & _
Request.Form("MinPrice") & "', '" & Request.Form("Increment")
& _
"', " & Request.Form("Available") & ")"


rst.open strSQL, strConnectionString


'Clean up
set rst = nothing

The bids are a bit harder to manage. Let's look at these in more detail.