Hi,
I have an asp page (Page2) that display a table of records, invoice#. When user clicks submit then Page2 submits itself and update those invoice# by putting time stamp to database file. When finish updating, it redirect to the input page (Page1). Sometime it work fine but sometime user claims that she click submit later on found out that those invoices did not get stampped.
She did not see any differences whether the update was success or not. It's always took her back to the page1 like it suppose to. Reason that she knows some of the batch fail because she were able to pull those data again.
The way she pull data to this page is by batch#. When it has a problem, the whole batch did not get stampped.
For example she enter batch# AAA, the asp display as below
----------------------------------------
Invoice#
123
222
333
444
Submit
-----------------------------------------
When I ask her to try again then it work fine.
She have to do this same job everyday, submit each batch of invoices, couple batches a day. Someday all the batches got stampped. Someday 1 or 2 batches did not get stampped.
Below is my code that do the update. Can anyone see if anything wrong with my code. Or what other possibility that could cause the problem. I don't think user forget to process some of them. She said she wrote down each batch# that she process.
By the way, I think I don't need the code in red. Can I take them out?
Thank you in advance for any help.
I have an asp page (Page2) that display a table of records, invoice#. When user clicks submit then Page2 submits itself and update those invoice# by putting time stamp to database file. When finish updating, it redirect to the input page (Page1). Sometime it work fine but sometime user claims that she click submit later on found out that those invoices did not get stampped.
She did not see any differences whether the update was success or not. It's always took her back to the page1 like it suppose to. Reason that she knows some of the batch fail because she were able to pull those data again.
The way she pull data to this page is by batch#. When it has a problem, the whole batch did not get stampped.
For example she enter batch# AAA, the asp display as below
----------------------------------------
Invoice#
123
222
333
444
Submit
-----------------------------------------
When I ask her to try again then it work fine.
She have to do this same job everyday, submit each batch of invoices, couple batches a day. Someday all the batches got stampped. Someday 1 or 2 batches did not get stampped.
Below is my code that do the update. Can anyone see if anything wrong with my code. Or what other possibility that could cause the problem. I don't think user forget to process some of them. She said she wrote down each batch# that she process.
By the way, I think I don't need the code in red. Can I take them out?
Thank you in advance for any help.
Code:
if strflag > "" then 'strflag = 1 = after submit itself
// build odbc
set objconn= server.createobject("adodb.connection")
objconn.open "DSN=as400DSN; database=172.16.1.10; uid=NO; pwd=XXXX; "
[COLOR=red]
set rsMVAPH=server.CreateObject("ADODB.recordset") [/color]
// Output to Invoice Payable Header
for idx = 1 to request.form("invnumber").count
apprinv = "apprinv" & idx-1
varapprinv = request(apprinv)
if varapprinv = "on" then
strinvnumber = request.form("invnumber")(idx)
strpaynumber = request("bankid")(idx) + mid(sysDate,3,6)
sqll = "update cisdtalib.$mvaph"
sqll = sqll & " set phapvu= '"& username&"' , phapvd= '"&sysdate&"', phpmt#= '"&strpaynumber&"' , phstag = '"&strinvflag&"'"
sqll = sqll & " where phinv#= '"&strinvnumber&"'"
objconn.execute(sqll)
end if
next
[COLOR=red]
set rsMVAPH=nothing[/color]
objconn.close
set objconn = nothing
newurl = "mv_payapprove.asp"
Response.redirect newurl
end if ' strflag = 1
Code:
<form action="page2.asp?flag=1" method="post" name="f1">