PDA

View Full Version : e-commerce: resubmission of hidden values


turnknuckle
10-13-2002, 12:20 AM
Greetings all.

Ive writtten an ecommerce solution that pulls 3 values (description, cost and a unique reference number) from a database and sends them as hidden values to a virtual card vendor, the values are subitting fine, and the users browser is directed to an approved or declined page, no hassles, my problem is that if the user gets sent to the 'declined' page and wishes to retry the transaction, those same values need to be resent to the card vendor, except that the unique reference number has to be different, ive put a link to the following page from my declined response page, here's my script for the resend page:
(i suspect that im overlooking something obvious here, maybe i need some sleep!)



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<%

Dim strUserName

strUserName = Request.QueryString("name")

Set DB = Server.CreateObject("ADODB.Connection")

strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("medi_salesB.mdb")
Set RS = Server.Createobject ("ADODB.Recordset")
strSQL = "SELECT client_table.ref_number, client_table.description, client_table.cost FROM client_table WHERE client_table.ref_number ='" & strUserName & "'"

RS.Open strSQL, strCon

%>

<form method="POST" action="https://www.vcs.co.za/vvonline/ccform.asp">

<input type="hidden" name="p1" value="ZE23">
<input type="hidden" name="p2" value="<%=RS.Fields ("ref_number")%> & "retry"">
<input type="hidden" name="p3" value="<%=RS.Fields ("description")%>">
<input type="hidden" name="p4" value="<%=RS.Fields ("cost")%>">

</form>

<input type="submit" name="Submit" value="Retry">

<%
RS.Close
Set DB = Nothing
Set strCon = Nothing
Set RS = Nothing
%>
</html>

this is the error msg:


ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/mediscapes/datatest/retry_trans2.asp, line 0

Thanks...
turnknuckle

whammy
10-13-2002, 02:00 AM
Hmm... try this to see what you're actually requesting from the db:

strSQL = "SELECT client_table.ref_number, client_table.description, client_table.cost FROM client_table WHERE client_table.ref_number ='" & strUserName & "'"

Response.Write(strSQL) : Response.End

turnknuckle
10-13-2002, 02:54 AM
Hey Whammy

SELECT client_table.ref_number, client_table.description, client_table.cost FROM client_table WHERE client_table.ref_number =''

any ideas why its only seeing it as a string???

turnknuckle
10-13-2002, 03:24 AM
Ive just tried linking from the 'declined' page directly back to the page the user logs onto initially to view their purchase details - even before they enter their payment details, and im getting the same
error...

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

really confusing, that shouldnt present a problem as all...

t.

whammy
10-13-2002, 05:36 AM
Isn't Request.QueryString("name") a string? It looks to me like you're trying to identify a primary key instead.

strUserName = Request.QueryString("name")

...

strSQL = "SELECT client_table.ref_number, client_table.description, client_table.cost FROM client_table WHERE client_table.ref_number ='" & strUserName & "'"

:confused: