Make our own ebay (auction system) (4)

Source: Internet
Author: User
Tags insert
We'll discuss the easy part. You'll have to create a few forms-one for the users to register (which, get themselves into our auctionusers table), a nd one for sellers to post their info. These forms should are easy to create if you know how to handle forms (check out this WDVL article for more information). Basically, you should collect 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 the more detail.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.