Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Please, help, Help Please, Very urgent


Message #1 by ggebre@h... on Sun, 18 Aug 2002 10:33:23
<% Option Explicit %>
<%

Dim strSQL

Dim RsBidder

Dim RSCustomer

Dim TheMessage

Dim Conn

Dim CurrentDateTime

Dim RSID

Dim RSItem

Dim ItemID

set conn = server.createobject ("adodb.connection")

conn.open Application("DB_Connectionstring")

set RSCustomer = conn.Execute("select CustomerID, EmailAddress from 
Customer
where " _

& "EmailAddress = '" & Request.Form("EmailAddress") & "' and " _

& "Password = '" & Request.Form("Password") & "'")

CurrentDateTime = Now

strSQL = "insert into Bids (BidderID, ItemID, BidAmount, WhenPlaced) values
(" _

& "'" & Request.Form("BidderID") & "', " _

& "'" & Request.Form("ItemID") & "', " _

& "'" & Request.Form("BidAmount") & "', " _

& "'" & CurrentDateTime & "')"

conn.Execute strSQL

Response.write ("BidderID")

Response.write ("ItemID")

response.write ("BidAmount")


set RSID = conn.Execute("select BidID from bids where " _

& "WhenPlaced = '" & CurrentDateTime & "'")


%>


BidderIDItemIDBidAmount

When a user bids on an item, the above program is suppose to cupture the 
bid
information and pass it onto the data base. But for some reasons it is not
doing what I exepected to to do.  With my little troubleshooting I receive
the following output.  Please help.
BidderIDItemIDBidAmount

Message #2 by "leorio" <leorio> on Sun, 18 Aug 2002 13:01:09
what's the problem?
i need detail...
Message #3 by ggebre@h... on Sun, 18 Aug 2002 18:31:54
> what's the problem?
i>  need detail... 

There is no error. What I am trying to do is, I wrote a program that would 
allow people to bid on an item. When the bid is placed, I wanted the 
values to be inserted into the bid table.   And for some reasons, it is 
not working it is not inserting the values to the bid table.   
Message #4 by "Zee Computer Consulting" <zee@t...> on Sun, 18 Aug 2002 20:50:48 -0700
Instead of these statements:

    Response.write ("BidderID")
    Response.write ("ItemID")
    response.write ("BidAmount")

use this:

    Response.Write( strSQL )

and you will see your SQL statement.


You might want to first store your form values in variables so that you can
write them out for debugging purposes:

    BidAmount = Request.Form( "BidAmount" )
    Response.Write( "<p>" & BidAmount & "</p>")

and take notice that BidAmount is likely a numeric field in a database, or
it should be, and therefore isn't quoted by single quotes in SQL statements.

Also: You may need to close your connection and other objects at the end of
the code section.

-- Zee



----- Original Message -----
From: <ggebre@h...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, August 18, 2002 10:33 AM
Subject: [access_asp] Please, help, Help Please, Very urgent


> <% Option Explicit %>
> <%
>
> Dim strSQL
>
> Dim RsBidder
>
> Dim RSCustomer
>
> Dim TheMessage
>
> Dim Conn
>
> Dim CurrentDateTime
>
> Dim RSID
>
> Dim RSItem
>
> Dim ItemID
>
> set conn = server.createobject ("adodb.connection")
>
> conn.open Application("DB_Connectionstring")
>
> set RSCustomer = conn.Execute("select CustomerID, EmailAddress from
> Customer
> where " _
>
> & "EmailAddress = '" & Request.Form("EmailAddress") & "' and " _
>
> & "Password = '" & Request.Form("Password") & "'")
>
> CurrentDateTime = Now
>
> strSQL = "insert into Bids (BidderID, ItemID, BidAmount, WhenPlaced)
values
> (" _
>
> & "'" & Request.Form("BidderID") & "', " _
>
> & "'" & Request.Form("ItemID") & "', " _
>
> & "'" & Request.Form("BidAmount") & "', " _
>
> & "'" & CurrentDateTime & "')"
>
> conn.Execute strSQL
>
> Response.write ("BidderID")
>
> Response.write ("ItemID")
>
> response.write ("BidAmount")
>
>
> set RSID = conn.Execute("select BidID from bids where " _
>
> & "WhenPlaced = '" & CurrentDateTime & "'")
>
>
> %>
>
>
> BidderIDItemIDBidAmount
>
> When a user bids on an item, the above program is suppose to cupture the
> bid
> information and pass it onto the data base. But for some reasons it is not
> doing what I exepected to to do.  With my little troubleshooting I receive
> the following output.  Please help.
> BidderIDItemIDBidAmount
>
>



  Return to Index