|
Keep getting end if error from this page....
Please please help this not even sure if I am approaching this right.......
<!--#include file="Library.inc"-->
<HTML>
<HEAD>
<Body>
<% Response.Buffer = true %>
<%
dim strTitle, strAuthor, strIsbn, strCategory
strTitle = request.form("&txTitle&")
strAuthor = request.form("&txtAuthor&")
strIsbn = request.form("&txtIsbn&")
strCategory = request.form("&Category&")
%>
<%if strTitle = "" then%>
<%Response.write("Please enter a Title")%>
<table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="/forum/btn_bytitle.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="/forum/btn_bytitle.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></td>
<%else%>
<%
dim objrsBooks, sql
sql = "SELECT * FROM Books WHERE Title = '" & strTitle & "'"
set objrsBooks = Server.CreateObject("ADODB.Recordset")
objrsBooks.Open sql, objConn
if objrsBooks.EOF or objrBooks.bof then%>
<P><H3>There is no book with that Title</H3></P>
<%Else%>
<TABLE BORDER="1" >
<TR>
<TH>Book ID</TH>
<TH>ISBN</TH>
<TH>Title</TH>
<TH>Author</TH>
<TH>Due Date</TH>
<TH>Member</TH>
</TR>
<%do while not objrsBooks.EOF
Response.Write "<TR align=center><TD>"
'Response.Write "<A HREF=""/forum/_UpdateBook_Action_return_ampBookID_.html" & objrsBooks("BookId") & """>"
Response.Write objrsBooks("BookId")
Response.Write "</a>"
Response.Write "</TD><TD>"
Response.Write objrsBooks("ISBN")
Response.Write "</TD><TD WIDTH=300>"
Response.Write objrsBooks("Title")
Response.Write "</TD><TD WIDTH=150>"
Response.Write objrsBooks("Author")
Response.Write "</TD><TD>"
'Response.Write FormatDateTime(objrsBooks("Date_Due"),2) 'ensure date is in short format
Response.Write "</TD><TD>"
Response.Write objrsBooks("User_Id")
Response.Write "</TD>"
objrsBooks.MoveNext
loop
objrsBooks.close%>
<%if strAuthor = "" then%>
<%Response.write("Please enter an Author")%>
<table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="/forum/btn_byauthor.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="/forum/btn_byauthor.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></td>
<%else%>
<%
sql = "SELECT * FROM Books WHERE Author = '" & strAuthor & "'"
set objrsBooks = Server.CreateObject("ADODB.Recordset")
objrsBooks.Open sql, objConn
if objrsBooks.EOF or objrsBooks.bof then%>
<P><H3>There is no book by that Author</H3></P>
<%Else%>
<TABLE BORDER="1" >
<TR>
<TH>Book ID</TH>
<TH>ISBN</TH>
<TH>Title</TH>
<TH>Author</TH>
<TH>Due Date</TH>
<TH>Member</TH>
</TR>
<%do while not objrsBooks.EOF
Response.Write "<TR align=center><TD>"
'Response.Write "<A HREF=""/forum/_UpdateBook_Action_return_ampBookID_.html" & objrsBooks("BookId") & """>"
Response.Write objrsBooks("BookId")
Response.Write "</a>"
Response.Write "</TD><TD>"
Response.Write objrsBooks("ISBN")
Response.Write "</TD><TD WIDTH=300>"
Response.Write objrsBooks("Title")
Response.Write "</TD><TD WIDTH=150>"
Response.Write objrsBooks("Author")
Response.Write "</TD><TD>"
'Response.Write FormatDateTime(objrsBooks("Date_Due"),2) 'ensure date is in short format
Response.Write "</TD><TD>"
Response.Write objrsBooks("User_Id")
Response.Write "</TD>"
objrsBooks.MoveNext
loop
objrsBooks.close%>
<%if strIsbn = "" then%>
<%Response.write("Please enter an Isbn")%>
<table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="/forum/btn_byisbn.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="/forum/btn_byisbn.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object></td>
<%else%>
<%
sql = "SELECT * FROM Books WHERE Isbn = '" &strIsbn& "'" 'search for all outstanding books
set objrsBooks = Server.CreateObject("ADODB.Recordset")
objrsBooks.Open sql, objConn
If objrsBooks.EOF or objrsBooks.bof then%>
<P><H3>There is no book with that Isbn</H3></P>
<% Else%>
<TABLE BORDER="1" >
<TR>
<TH>Book ID</TH>
<TH>ISBN</TH>
<TH>Title</TH>
<TH>Author</TH>
<TH>Due Date</TH>
<TH>Member</TH>
</TR>
<% do while not objrsBooks.EOF
Response.Write "<TR align=center><TD>"
'Response.Write "<A HREF=""/forum/_UpdateBook_Action_return_ampBookID_.html" & objrsBooks("BookId") & """>"
Response.Write objrsBooks("BookId")
Response.Write "</a>"
Response.Write "</TD><TD>"
Response.Write objrsBooks("ISBN")
Response.Write "</TD><TD WIDTH=300>"
Response.Write objrsBooks("Title")
Response.Write "</TD><TD WIDTH=150>"
Response.Write objrsBooks("Author")
Response.Write "</TD><TD>"
'Response.Write FormatDateTime(objrsBooks("Date_Due"),2) 'ensure date is in short format
Response.Write "</TD><TD>"
Response.Write objrsBooks("User_Id")
Response.Write "</TD>"
objrsBooks.MoveNext
loop
objrsBooks.close%>
<%if strCategory = "" then%>
<%Response.write("Please enter a Category")%>
<table width="25%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="/forum/btn_bycategory.swf">
<param name="quality" value="high">
<param name="base" value=".">
<embed src="/forum/btn_bycategory.swf" base="." quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
</object> </td>
<%else%>
<%
sql = "SELECT * FROM Books WHERE Category = '" &strCategory& "'" 'search for all outstanding books
set objrsBooks = Server.CreateObject("ADODB.Recordset")
objrsBooks.Open sql, objConn
If objrsBooks.EOF or objrsBooks.Bof then%>
<P><H3>There is no book in that Category</H3></P>
<%else%>
<TABLE BORDER="1" >
<TR>
<TH>Book ID</TH>
<TH>ISBN</TH>
<TH>Title</TH>
<TH>Author</TH>
<TH>Due Date</TH>
<TH>Member</TH>
</TR>
<%do while not objrsBooks.EOF
Response.Write "<TR align=center><TD>"
'Response.Write "<A HREF=""/forum/_UpdateBook_Action_return_ampBookID_.html" & objrsBooks("BookId") & """>"
Response.Write objrsBooks("BookId")
Response.Write "</a>"
Response.Write "</TD><TD>"
Response.Write objrsBooks("ISBN")
Response.Write "</TD><TD WIDTH=300>"
Response.Write objrsBooks("Title")
Response.Write "</TD><TD WIDTH=150>"
Response.Write objrsBooks("Author")
Response.Write "</TD><TD>"
'Response.Write FormatDateTime(objrsBooks("Date_Due"),2) 'ensure date is in short format
Response.Write "</TD><TD>"
Response.Write objrsBooks("User_Id")
Response.Write "</TD>"
objrsBooks.MoveNext
loop
objrsBooks.close
%>
<%end if%>
<%end If %><%end If %><%end If %><%end If %><%end If %><%end If %><%end If %><%end If %><%end If %>
<%end If %><%end If %><%end If %><%end If %><%end If %>
</TABLE>
</body>
</html>
|
|
|
please rectify how many your IF command
and must be same with END IF command.
make sure this...
hope can help you.
|
|
|
|
|
|
|
|