欢迎光临
我们一直在努力

制作我们自己的ebay(拍卖系统)(4)_asp实例

建站超值云服务器,限时71元/月

First, well discuss the easy part. Youll 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. Lets look at these in more detail.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 制作我们自己的ebay(拍卖系统)(4)_asp实例
分享到: 更多 (0)