I am in the process of creating an online 'auction'. I have two tables in my access dbase labled 'Item' and 'Bid'. Within the 'Item' table are field names ItemID, ItemName, ExpirationDate, and ItemStatus. Within the 'Bid' table are field names ItemID, and BidClose.
My script in addbid.asp (where the Bid table is filled) is:
<%
Dim objCmd, rsHighBid, varHighBid
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
strSQL = "SELECT Max(AdjBid) AS MaxBidAmount FROM Bid " & _
"WHERE ItemID = " & Request("ItemID"
& ";"
objCmd.CommandType = adCmdText
objCmd.CommandText = strSQL
Set rsHighBid = objCmd.Execute
If IsNull( rsHighBid("MaxBidAmount"
) Then
varHighBid = 0
Else
varHighBid = rsHighBid("MaxBidAmount"
End If
rsHighBid.Close
Set rsHighBid = Nothing
Dim rsBid
Set rsBid = Server.CreateObject("ADODB.Recordset"
rsBid.Open "Bid", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
rsBid.AddNew
rsBid("ItemID"
= Request.Form("ItemID"
rsBid("BidderID"
= Session("PersonID"
rsBid("BidLength"
= CCur(Request.Form("Sel"
)
rsBid("BidAmount"
= CCur(Request.Form("Bid"
)
rsBid("BidChange"
= CCur(Request.Form("Bid"
) * CCur(Request.Form("Sel"
)
rsBid("AdjBid"
= CCur(Request.Form("Bid"
) * ((3 - ABS(3-CCur(Request.Form("Sel"
)))+5.47)
rsBid("BidClose"
= CDate(now) + 1
rsBid("BidWord"
= FormatNumber(Request.Form("Sel"
,0) & " yrs/ " & FormatCurrency(Request.Form("Bid"
,0) & " per yr"
rsBid("Team"
= Request.Form("BidTeam"
rsBid.Update
Response.Redirect "BrowseListings.asp"
%>
My question is: How do I get it so that the ExpirationDate value in the item table is changed to the BidClose value in the Bid Table. I don't care how its done, either through the script or through the dbase - I just need it done!
And, as always, thanks in advance.
My script in addbid.asp (where the Bid table is filled) is:
<%
Dim objCmd, rsHighBid, varHighBid
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
strSQL = "SELECT Max(AdjBid) AS MaxBidAmount FROM Bid " & _
"WHERE ItemID = " & Request("ItemID"
objCmd.CommandType = adCmdText
objCmd.CommandText = strSQL
Set rsHighBid = objCmd.Execute
If IsNull( rsHighBid("MaxBidAmount"
varHighBid = 0
Else
varHighBid = rsHighBid("MaxBidAmount"
End If
rsHighBid.Close
Set rsHighBid = Nothing
Dim rsBid
Set rsBid = Server.CreateObject("ADODB.Recordset"
rsBid.Open "Bid", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
rsBid.AddNew
rsBid("ItemID"
rsBid("BidderID"
rsBid("BidLength"
rsBid("BidAmount"
rsBid("BidChange"
rsBid("AdjBid"
rsBid("BidClose"
rsBid("BidWord"
rsBid("Team"
rsBid.Update
Response.Redirect "BrowseListings.asp"
%>
My question is: How do I get it so that the ExpirationDate value in the item table is changed to the BidClose value in the Bid Table. I don't care how its done, either through the script or through the dbase - I just need it done!
And, as always, thanks in advance.