% page=0 volume=0 id=0 book_num=0 Set Conn = Server.CreateObject("ADODB.Connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("cread.mdb") & ";" volume = Request("volume") page = Request("page") book_num = Request("book") id = Request("id") If id>0 And book_num>0 then SQLQuery = "SELECT * FROM BK" & book_num & " WHERE id=" & id Set Results = Conn.Execute(SQLQuery) elseIf page>0 And book_num>0 then SQLQuery = "SELECT * FROM BK" & book_num & " WHERE page=" & page & " AND part=" & volume Set Results = Conn.Execute(SQLQuery) else no_body = True end if %>
<%If no_body And book_num=0 Then%><% Results.Close Conn.Close %><% If no_body Then If book_num>0 Then getBookSubjects(book_num) Else getBookList() End If Response.end End IF If Results.EOF then Response.write("
You have reached the end of the book.") Response.end Else If Results.BOF then Response.write("
You have reached the beginning of the book.") Response.end else textStr = Results("TEXT") colorText(textStr) id = Results("ID") end if End If 'On Error Resume Next 'Results.MoveNext 'If Results.EOF Then ' next_id = 0 'else ' next_id = Results("ID") 'end if 'Results.MovePrevious Set TempRS = Conn.Execute("SELECT * FROM BK" & book_num & " WHERE id=" & (id*1)+1) If TempRS.EOF then next_id = 0 else next_id = (id*1)+1 end if Set TempRS = Conn.Execute("SELECT * FROM BK" & book_num & " WHERE id=" & (id*1)-1) If TempRS.EOF then previous_id = 0 else previous_id = (id*1)-1 end if TempRS.Close%>
كتاب <%= getBookName(book_num) %>، الجزء <%= Results("part") %>، صفحة <%= Results("page") %>.