Odd situation here (to me, anyway). Hugest thanks if you can help me solve it!
I have an ASP page that works great. It connects to a database, retrieves information and displays it in a table. I just want to update the html to current standards. When I attempt to disuse deprecated tags, I get this error message displayed where indicated below: "An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here</a> to find out more about this error." Of course the link is too general (or I'm not smart enough) to shed any light on the problem causing the issue.
Here's the really odd thing: with the first try at the update, the error was thrown, I visited the link in the error message, and then when I hit the back button to return to the asp page, IT DISPLAYED CORRECTLY! (forehead slap and a WTF). Refreshing the page threw the error again.
I've also tried changing single quotation marks for double double quotation marks within the vbscript; remarking out lines and stepping through them one by one to isolate the error. I just don't have enough savvy to suss it out
The working version is in black, with lines that have changed syntax or been added in green, and comments in red. Thanks again to all.
Code:<%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit 'Response.Buffer = True 'Check if user is logged in If Session("name") = "" and Session("number")="" Then 'If not, go to login page Response.Redirect("login.asp") End If If Request.Cookies("Pvp91sZG") = "PhdZuT7O" Then Response.Redirect("../AccessDenied.htm") End If If Request.Cookies("dhcpFn4H") = "2twVlXrx" Then Dim strIP Dim conn Dim rs Dim strSQL Dim strConnection Dim AcctNum Dim i Dim InOut Dim temp Dim Content Content = "" Set conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") strConnection = "FILEDSN=" & Server.MapPath("SACA.dsn") & ";DBQ=" & Server.MapPath(Session("db")) & ";" AcctNum = Session("number") conn.Open strConnection strSQL = "SELECT nfldButton, nfldItemNum, ynfldCheckInOut, tfldArtist, tfldTitle, tfldMedia, tfldLocation FROM tblItems WHERE nfldAccountNum=" & AcctNum & " ORDER BY idxItems ASC;" InOut = array("IN", "OUT") set rs = conn.Execute (strSQL) If (rs.BOF and rs.EOF) Then Response.Write "No records have yet been entered for this account." Response.End rs.Close conn.close set rs=nothing set conn=nothing Response.End End If Response.Write("<TITLE>" & Session("name") & " Collection</TITLE>") Response.write("<left><b>" & Session("name") & " Collection, Account #" & Session("number") & "<br><a href=logout.asp>Logout</a></b></left><br>") Replaced with: Response.write("<b>" & Session("name") & " Collection, Account #" & Session("number") & "<br><a href='logout.asp'>Logout</a></b><br>") Content = Content & "<FORM NAME=frmSearch METHOD=POST ACTION=clxnsrch.asp>" Content = Content & "<TR><TD Align=right><b>Search for:</b> <input type=text name=txtTerms size=25> <b>Search in:</b> " & _ Replaced with: Content = Content & "<tr><td style='text-align: right;'><b>Search for:</b> <input type=text name=txtTerms size=25> <b>Search in:</b> " & _ "<select name=selField size=1>" & _ "<option value=Artist>Artist</option>" & _ "<option value=Title>Title</option>" & _ "<option value=Media>Media</option>" & _ "<option value=Location>Location</option>" & _ "<option value=All>All</option>" & _ "</select> " & _ "<input type=submit name=btnSearch value=Search></TD></TR></FORM>" Else Response.Redirect("login.asp") End If %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Added <HTML> <HEAD> <style type="text/css"> <!-- INPUT { font-family: ; font-size: ; font-weight: ; color: ; background-color: ; padding: ; height: ; width: ; } INPUT.GoButton { background-color: ; border-color: ; color: ; font-family: arial, verdana, ms sans serif; font-weight: normal; font-size: 6pt; text-align: center; height: 15px; width: 40px; } --> </style> </HEAD> <BODY> Replaced with: <body style="background-color: white; text-align: left;"> <br> <div style="text-align: center;"> <div style="width: 85%; margin-left: auto; margin-right: auto;"> Added <TABLE Align = "Center" BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="85%"> Replaced with: <table style="border: none; border-spacing: 2px; padding: 2px; width: 85%; text-align: center; margin: auto;"> <% Response.Write(Content) %> </TABLE> <TABLE Align = "Center" BORDER="1" CELLPADDING="2" CELLSPACING="2" WIDTH="85%"> Replaced with: <table style="border: 1px; border-spacing: 2px; padding: 2px; width: 85%; text-align: center; margin: auto;"> <% Response.Write "<TR BGCOLOR=""#CCCCCC""><TH> </TH><TH>Item Number</TH><TH>IN / OUT</TH><TH>Artist</TH><TH>Title</TH><TH>Media</TH><TH>Location</TH></TR>" Replaced with: Response.Write "<tr style='background-color: #CCCCCC;'><th> </th><th>Item Number</th><th>IN / OUT</th><th>Artist</th><th>Title</th><th>Media</th><th>Location</th></tr>" All the above amendments in green seem to be working fine rs.MoveFirst Do While Not rs.EOF Response.Write "<TR><FORM Action='item.asp' Method='Post'>" Error occurs somewhere from here on For i = 0 to rs.Fields.Count - 1 temp = rs.Fields(i) tdata = "<b><td style='font-family: arial; font-size: xx-small;" added variable to eliminate using <font> and <center> If i = 0 Then temp = "</b></font><center><INPUT Type=Hidden Name='ItemNumber' Value=" & rs("nfldItemNum") & "><input type=Submit value=Go class='GoButton'></center><font><b>" Replaced with: temp = " text-align: center;'></b><input type=hidden name='ItemNumber' value=" & rs("nfldItemNum") & "><input type=submit value='Go' class='GoButton'><b>" End If If i = 1 Then temp = "<center>" & temp & "</center>" Replaced with: temp = " text-align: center;'>" & temp End If If i = 2 Then If temp + 1 = 0 Then temp = "</font><font FACE=""ARIAL"" SIZE=""1"" color = ""#009900""><center>" & InOut(temp + 1) & "</center></font>" Replaced with: temp = " color: #009900; text-align: center;'>" & InOut(temp + 1) Else If temp + 1 = 1 Then temp = "</font><font FACE=""ARIAL"" SIZE=""1"" color = ""#FF0000""><center>" & InOut(temp + 1) & "</center></font>" Replaced with: temp = " color: #FF0000; text-align: center;'>" & InOut(temp + 1) End If End If End If If i = 4 Then temp = "<i>" & temp & "</i>" It seems that assembling the table as in green below, incorporating the above green variables, is where the error is generated Response.Write "<TD><FONT FACE=""ARIAL"" SIZE=""1""><b>" & temp & "</b></font></TD>" Replaced with: Response.Write tdata & "" & temp & "</b></td>" The table displayed correctly only when I left the page and then used the browser's back button! I also tried instead of this line: Response.Write(tdata) Response.Write(temp) & "</b></td>" also tried: WriteData = tdata & "" & temp & "</b></td>" added a variable to hold both values and include closing tags Response.Write(WriteData) Next Response.write "</FORM></TR>" rs.MoveNext Loop rs.Close set rs = Nothing conn.Close set conn = Nothing %> </TABLE> </div> </div> Added </BODY> </HTML>


(right side on this reply ) and agree

