Hi,
I have 2 asp pages. page1 let user enter vendor#. Page2 list out all the invoices under that vendor and a check box next to each invoice. The check box is default checked. On page2 when user click submit, it submit itself. It checks for invoice that has check in check box and call cgi pgm to update flag in database. After finished processing the whole list then it uses response.redirect to page1.
The operation process is repeated, search for vendor(page1) then submit the list(apge2), then search for next vendor and submit listing, on and on for about 5-6 vendors per day.
Very often, one whole list did not get process. After user click submit on page2, it took her back to page1 like it suppose to. But actually it did not process any invoice in that list at all. If she repeat again then it's ok.
I don't know if this info is relavant but it's never happen on the first batch (vendor). It's ususally happen to only 1 out of those 5-6 vendors. But someday everything went fine. User always leave the check box checked.
I tried to set the flag 'updateok' and use that flag to redirect the page. But the fail batch and the successed batch always go to page1, nothing different.
Is it possible that the communicaton fail when it calls CGI program? How do I check?
Is there anywhere else that I can monitor the error (any error)?
Thank for any help/feedback.
I have 2 asp pages. page1 let user enter vendor#. Page2 list out all the invoices under that vendor and a check box next to each invoice. The check box is default checked. On page2 when user click submit, it submit itself. It checks for invoice that has check in check box and call cgi pgm to update flag in database. After finished processing the whole list then it uses response.redirect to page1.
The operation process is repeated, search for vendor(page1) then submit the list(apge2), then search for next vendor and submit listing, on and on for about 5-6 vendors per day.
Very often, one whole list did not get process. After user click submit on page2, it took her back to page1 like it suppose to. But actually it did not process any invoice in that list at all. If she repeat again then it's ok.
I don't know if this info is relavant but it's never happen on the first batch (vendor). It's ususally happen to only 1 out of those 5-6 vendors. But someday everything went fine. User always leave the check box checked.
I tried to set the flag 'updateok' and use that flag to redirect the page. But the fail batch and the successed batch always go to page1, nothing different.
Is it possible that the communicaton fail when it calls CGI program? How do I check?
Is there anywhere else that I can monitor the error (any error)?
Thank for any help/feedback.
Code:
if strrcdcnt <> "" then 'record count > 0 after submit itself
for idx = 1 to strrcdcnt
apprinv = "apprinv" & idx-1
varapprinv = request(apprinv)
inv = "inv" & idx-1
bnkid = "bnkid" & idx-1
// check if check box being checked then call cgi
// to update flag
if varapprinv = "on" then
strinvnumber = request.form(inv)
strbankid = request.form(bnkid) 'rk02
as400url = "[URL unfurl="true"]http://172.16.1.10/cgi-bin2/xmv190?"+[/URL] username + "+" + strinvnumber + "+" + strbankid
Set xmldoc = ReadXMLFromAS400(as400url)
updateok = "Y"
end if
next
if (updateok = "Y") then
newurl = "page1.asp"
Response.redirect newurl
else
nodataerror = "error.asp?error=processerror&reason=No update flag, cannot process payment approval."
Response.redirect nodataerror
end if
end if ' strrcdcnt <> ""
%>
Code:
<%
// General function to read an XML document from the AS/400
function ReadXMLFromAS400 (urlsource)
dim xmldoc
errorpage = "error.asp?error=server&backpage=tracking.asp"
Set xmldoc = Server.CreateObject("MSXML2.DOMDocument")
xmldoc.async = False
xmldoc.setProperty "ServerHTTPRequest", true
xmldoc.load (urlsource)
// do until (xmldoc.readystate = 4)
// Loop
'Check for a successful load of the XML Document.
if xmldoc.parseerror.errorcode <> 0 then
Response.redirect errorpage
Response.Write xmldoc.text
Response.Write "----------------------------" & "<BR>"
Response.Write "Error Code : " & xmldoc.parseerror.errorcode & "<BR>"
Response.Write "Reason : " & xmldoc.parseerror.reason & "<BR>"
Response.End
end if
set ReadXMLFromAS400 = xmldoc
end function
%>