Odd situation here. Hugest thanks if you can help me solve it! I'm betting you can, because on this forum I've found solutions to all but one of my posts!
This page displays as intended:
When I attempt to bring it into w3c compliance, i.e. disuse deprecated tags (code below), I get this error message displayed after the search form: "An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click <a href=" 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.
In the green line, I also tried instead:
and
Here's the really odd thing: with the first try at w3c compliance, 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, [red]IT DISPLAYED CORRECTLY![/red] (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, I guess. You guys and girls rock, though--I'll bet you'll see it in one minute flat. Sorry for all the lengthiness.
Thanks in advance,
Phillip
This page displays as intended:
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>")
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> " & _
"<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
%>
<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>
<br>
<TABLE Align = "Center" BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="85%">
<%
Response.Write(Content)
%>
</TABLE>
<TABLE Align = "Center" BORDER="1" CELLPADDING="2" CELLSPACING="2" WIDTH="85%">
<%
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>"
rs.MoveFirst
Do While Not rs.EOF
Response.Write "<TR><FORM Action='item.asp' Method='Post'>"
For i = 0 to rs.Fields.Count - 1
temp = rs.Fields(i)
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>"
End If
If i = 1 Then
temp = "<center>" & temp & "</center>"
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>"
Else
If temp + 1 = 1 Then
temp = "</font><font FACE=""ARIAL"" SIZE=""1"" color = ""#FF0000""><center>" & InOut(temp + 1) & "</center></font>"
End If
End If
End If
If i = 4 Then temp = "<i>" & temp & "</i>"
Response.Write "<TD><FONT FACE=""ARIAL"" SIZE=""1""><b>" & temp & "</b></font></TD>"
Next
Response.write "</FORM></TR>"
rs.MoveNext
Loop
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
%>
</TABLE>
</BODY>
</HTML>
When I attempt to bring it into w3c compliance, i.e. disuse deprecated tags (code below), I get this error message displayed after the search form: "An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click <a href=" 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.
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("<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 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"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<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 style="background-color: white; text-align: left;">
<br>
<div style="text-align: center;">
<div style="width: 85%; margin-left: auto; margin-right: auto;">
<table style="border: none; border-spacing: 2px; padding: 2px; width: 85%; text-align: center; margin: auto;">
<%
Response.Write(Content)
%>
</table>
<table style="border: 1px; border-spacing: 2px; padding: 2px; width: 85%; text-align: center; margin: auto;">
<%
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>"
rs.MoveFirst
Do While Not rs.EOF
Response.Write "<tr><form action='item.asp' method='post'>" [red]Error occurs somewhere from here on[/red]
For i = 0 to rs.Fields.Count - 1
temp = rs.Fields(i)
tdata = "<b><td style='font-family: arial; font-size: xx-small;"
If i = 0 Then
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 = " text-align: center;'>" & temp
End If
If i = 2 Then
If temp + 1 = 0 Then
temp = " color: #009900; text-align: center;'>" & InOut(temp + 1)
Else
If temp + 1 = 1 Then
temp = " color: #FF0000; text-align: center;'>" & InOut(temp + 1)
End If
End If
End If
If i = 4 Then temp = "<i>" & temp & "</i>"
[green] Response.Write tdata & "" & temp & "</b></td>" [/green]
Next
Response.write "</form></tr>"
rs.MoveNext
Loop
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
%>
</table>
</div>
</div>
</body>
</html>
In the green line, I also tried instead:
Code:
Response.Write(tdata)
Response.Write(temp) & "</b></td>"
and
Code:
WriteData = tdata & "" & temp & "</b></td>"
Response.Write(WriteData)
Here's the really odd thing: with the first try at w3c compliance, 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, [red]IT DISPLAYED CORRECTLY![/red] (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, I guess. You guys and girls rock, though--I'll bet you'll see it in one minute flat. Sorry for all the lengthiness.
Thanks in advance,
Phillip