Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2004, 06:51 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default what's wrong with this?

how can I activate the drop down box?

[code]<%
'************************************************* ***********************************
'* ADO Recordset Paging Sample Script
'* by Konstantin Vasserman
'* June 2000
'************************************************* ***********************************

Option Explicit

'************************************************* ***********************************
'* Declaration section
'************************************************* ***********************************
' Mode contstants
Const MODE_DEFAULT = 1
Const MODE_RESULTS = 2

Const DB_NAME = "bible.mdb" ' Name of our database file
Const SCRIPT_NAME = "bible8.asp" ' Name of this script

Const RECORDS_PER_PAGE = 20 ' Number of records per page

Dim nMode ' Current Mode
'************************************************* ***********************************
'* End of Declaration section
'************************************************* ***********************************

'************************************************* ***********************************
'* Main section
'************************************************* ***********************************

' Find out what mode we are in
nMode = CLng(Request.QueryString("Mode"))

' Depending on our mode we will do different things
Select Case nMode

    Case MODE_RESULTS
        ' This is where all the results will show
        ShowResults

    Case Else ' This one is for MODE_DEFAULT or invalid modes all the same
        ' By default display the search form
        Call ShowSearchForm
End Select

'************************************************* ***********************************
'* End of Main section
'************************************************* ***********************************

'************************************************* ***********************************
'* Functions section
'************************************************* ***********************************

' This function will generate our connection string
' it assumes that Access database is in the same folder as this script
Private Function GetConnectionString()
    GetConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
                "DBQ=" & Server.MapPath(DB_NAME) & ";" & _
                "UID=;PWD=;"
End Function

' Shows HTML page header
Public Sub OutputPageHeader()
    %>
    <HTML>
    <HEAD><TITLE>ADO Recordset Paging Sample</TITLE>
    <script language="javascript">
function EnableDisable()
{
    if(document.kjbible.optAction[0].checked){

        for(i=0;i<document.kjbible.recordType.length;i++)
            document.kjbible.recordType[i].disabled=false;

        for(i=0;i<document.kjbible.book.length;i++)
            document.kjbible.book[i].disabled=true;

        for(i=0;i<document.kjbible.book_spoke.length;i++)
            document.kjbible.book_spoke[i].disabled=true;

    document.kjbible.book.disabled = true;
    document.kjbible.book_spoke.disabled = true;
    document.kjbible.book_title.disabled = true;
  }


    if(document.kjbible.optAction[1].checked){

        for(i=0;i<document.kjbible.recordType.length;i++)
            document.kjbible.recordType[i].disabled=true;

        for(i=0;i<document.kjbible.book.length;i++)
            document.kjbible.book[i].disabled=false;

        for(i=0;i<document.kjbible.book_spoke.length;i++)
            document.kjbible.book_spoke[i].disabled=false;

    document.kjbible.book.disabled = false;
    document.kjbible.book_spoke.disabled = false;
    document.kjbible.book_title.disabled = false;

  }

}
function Reset()
{
   for(i=0;i<document.kjbible.recordType.length;i++)
      document.kjbible.recordType[i].disabled=false;

   for(i=0;i<document.kjbible.book.length;i++)
      document.kjbible.book[i].disabled=true;

   for(i=0;i<document.kjbible.book_spoke.length;i++)
      document.kjbible.book_spoke[i].disabled=true;

   document.kjbible.book.disabled = true;
   document.kjbible.book_spoke.disabled = true;
   document.kjbible.book_title.disabled = true;
}

</script>

    </HEAD>
     <BODY Onload="Javascript:EnableDisable();">
    <H2><b>Search the Bible<b></H2>
    <H3><A HREF="<%=SCRIPT_NAME%>">Back Home</A></H3>

    <%
End Sub

' Shows HTML page footer
Public Sub OutputPageFooter()
    %>
    </BODY>
    </HTML>
    <%
End Sub

' This function will display the search form
Public Sub ShowSearchForm()
    Call OutputPageHeader
    %>
    <!--
        This form will direct user to itself with MODE_RESULTS mode
    -->
    <table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; border-style: none; border-width: medium" width="509">
  <tr style="height:123.25pt">
    <td width="363" valign="top" style="height: 123.25pt; border: .5pt solid windowtext; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal">
      <form name="kjbible" action="<%=SCRIPT_NAME%>" method="get">

      Look for: <input TYPE="text" NAME="Keyword" size="20"><input TYPE="submit" VALUE="Search"><input TYPE="reset">&nbsp;<o:p>

      </o:p>
      <p class="MsoNormal">If you search number write 001 instead of 1 and 022
      instead of 22<br>
      <input TYPE="radio" CHECKED NAME="optAction" onclick="Javascript:EnableDisable();">Your selection of books<br>
      <input TYPE="radio" NAME="optAction" onclick="javascript:EnableDisable();">The entire King James Bible<br>
      <br>
      <input TYPE="CheckBox" NAME="book" VALUE="book">Book<br>
      <input TYPE="CheckBox" NAME="book_title" VALUE="book_title">Book Title<br>
      <input TYPE="CheckBox" NAME="chapter" VALUE="chapter">Chapter<br>
      <input TYPE="CheckBox" NAME="verse" VALUE="verse">Verse<br>
      <input TYPE="CheckBox" CHECKED NAME="text_data" VALUE="text">Text<o:p>
      </o:p>
    </td>
    <td width="115" valign="top" style="mso-border-left-alt: solid windowtext .5pt; height: 123.25pt; border-left-style: none; border-left-width: medium; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"><br>
      <select name="spokes" size="1">
        <option SELECTED VALUE="none">None</option>
        <option VALUE="spoke 1">spoke 1</option>
        <option VALUE="spoke 2">spoke 2</option>
        <option VALUE="spoke 3">spoke 3</option>
        <option VALUE="spoke 4">spoke 4</option>
        <option VALUE="spoke 5">spoke 5</option>
        <option VALUE="spoke 6">spoke 6</option>
        <option VALUE="spoke 7">spoke 7</option>
        <option VALUE="spoke 8">spoke 8</option>
        <option VALUE="spoke 9">spoke 9</option>
        <option VALUE="spoke 10">spoke 10</option>
        <option VALUE="spoke 11">spoke 11</option>
        <option VALUE="spoke 12">spoke 12</option>
        <option VALUE="spoke 13">spoke 13</option>
        <option VALUE="spoke 14">spoke 14</option>
        <option VALUE="spoke 15">spoke 15</option>
        <option VALUE="spoke 16">spoke 16</option>
        <option VALUE="spoke 17">spoke 17</option>
        <option VALUE="spoke 18">spoke 18</option>
        <option VALUE="spoke 19">spoke 19</option>
        <option VALUE="spoke 20">spoke 20</option>
        <option VALUE="spoke 21">spoke 21</option>
        <option VALUE="spoke 22">spoke 22</option>
      </select><br>
      You may choose from the 22 spokes (for a definition of what a "spoke" is go to <a href="http://www.biblewheel.com">www.biblewheel.com</a>)
      <p class="MsoNormal"><o:p><input TYPE="CheckBox" NAME="book_spoke" VALUE="Book_Spoke">Book
      Spoke<br>
      <input TYPE="CheckBox" NAME="chapter_spoke" VALUE="chapter_spoke">Chapter
      Spoke<br>
      <input TYPE="CheckBox" NAME="verse_spoke" VALUE="verse_spoke">Verse Spoke<o:p>
      </o:p>
      </p>
      <p class="MsoNormal">&nbsp;<o:p>
      </o:p>
      </p>
      <p class="MsoNormal"><br>
      </o:p>
      </p>
    </td>
  </tr>
  <tr style="height:216.4pt">
    <td width="493" colspan="2" valign="top" style="mso-border-top-alt: solid windowtext .5pt; height: 216.4pt; border-left: .5pt solid windowtext; border-right: .5pt solid windowtext; border-top-style: none; border-top-width: medium; border-bottom: .5pt solid windowtext; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal">Search: <o:p>
      </o:p>
      </p>
      <p>Where do you want to search?<o:p>
      </o:p>
      </p>
      <table border="1" cellpadding="0" width="100%" style="width:100.0%;mso-cellspacing:
  1.5pt" height="500">
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" CHECKED NAME="recordType" VALUE="gn">Genesis<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" CHECKED NAME="recordType" VALUE="is">Isaiah<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" CHECKED NAME="recordType" VALUE="ro">Romans<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ex">Exodus<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="je">Jeremiah<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="co">1
            Corinthians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="lv">Leviticus<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="la">Lamentations<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ci">2
            Corinthians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="nu">Numbers<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ez">Ezekiel<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ga">Galatians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="de">Deuteronomy<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="da">Daniel<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ep">Ephesians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="js">Joshua<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ho">Hosea<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ph">Philippians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jg">Judges<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jl">Joel<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="cl">Colossians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ru">Ruth<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="am">Amos<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="th">1
            Thessalonians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="sa">1
            Samuel<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ob">Obadiah
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="te">2
            Thessalonians<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="sm">2
            Samuel<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jh">Jonah
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ti">1
            Timothy<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ki">1
            Kings<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="mi">Micah
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="tm">2
            Timothy<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="kn">2
            Kings<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="na">Nahum
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="tt">Titus<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ch">1
            Chronicles<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="hb">Habakkuk
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="pl">Philemon<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="cr">2
            Chronicles<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ze">Zepheniah
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="he">Hebrews<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ea">Ezra<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ha">Haggai
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ja">James<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ne">Nehemiah<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="zc">Zechariah
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="pe">1
            Peter<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="es">Esther<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ml">Malachi
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="pt">2
            Peter<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jb">Job<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="mt">Matthew
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jn">1
            John<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ps">Psalms<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="mk">Mark
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jnn">2
            John<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="pr">Proverbs<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="lk">Luke
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jhn">3
            John<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ec">Ecclesiastes<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="jo">John
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ju">Jude<o:p>
            </o:p>
            </p>
          </td>
        </tr>
        <tr style="height:14.25pt">
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="so">Song
            of Solomon<o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="ac">Acts
            <o:p>
            </o:p>
            </p>
          </td>
          <td width="33%" style="width:33.0%;padding:.75pt .75pt .75pt .75pt;
   height:14.25pt">
            <p class="MsoNormal"><input TYPE="checkbox" NAME="recordType" VALUE="re">Revelation<o:p>
            </o:p>
            </p>
          </td>
        </tr>
      </table>
      <p class="MsoNormal"><o:p>
      </o:p>
      </p>
    </td>
  </tr>
  </form>
</table>
<p class="MsoNormal">&nbsp;<o:p>
</o:p>
</p>
    <%
    OutputPageFooter
End Sub

' This function will display the results of the search
Private Sub ShowResults()
    Dim strConn ' Database connection string
    Dim SQL ' String that will have our SQL statments
    Dim RS ' Recordset object
    Dim Keyword ' Keyword for search
    Dim nRecCount ' Number of records found
    Dim nPageCount ' Number of pages of records we have
    Dim nPage ' Current page number
    Dim iCounter 'for the checkboxes

    ' Let's see what page are we looking at right now
    nPage = CLng(Request.QueryString("Page"))

    ' Let's see what user wants to search for today :)
    Keyword = Trim(Request.QueryString("Keyword"))

    ' define our SQL statment
    ' we will be looking for all the records in tblItem table
    ' where ItemName contains our Keyword
    ' do not forget to fix tick marks (single quotes) in our Keyword
    SQL = "SELECT * FROM bible WHERE "

    ' Create our connection string
    strConn = GetConnectionString()
             Response.Write request.QueryString("book")
    If request.QueryString("book")="Book" then

      Sql = Sql & "book LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("book_spoke")="Book_Spoke" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "book_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("book_title")="Book_Title" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "book_title LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("chapter")="Chapter" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "chapter LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if


    If request.QueryString("chapter_spoke")="Chapter_Spok e" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "chapter_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("verse")="Verse" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "verse LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("verse_spoke")="Verse_Spoke" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "verse_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If request.QueryString("text_data")="Text" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If
 
Old August 17th, 2004, 07:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just toooooo long. I don't see anything wrong with this other than that, as my eyes refused to take a look at this.

Post, PART OF THE CODE that are relavant to the topic and not just the entire thing you have written.

It is really easy for me to write one line saying "how do I do this", and ask others take a look at all that I have written (including the comments). But in that case, I wouldn't expect anyone to reply me back. Anyone in this world would hate to take a look at such long post.

If I remember right, I myself have asked you to post the part of the code relevant to the topic in one of you other posts. Sorry, I am off from this.

_________________________
- Vijay G
Strive for Perfection
 
Old August 17th, 2004, 07:22 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'd figure the important part is the if/then statements?

I need the "spoke"s (book_spoke, chapter_spoke, and verse_spoke)checkboxes to enable the dropdown. Plus the coding for the dropdown. Those in bold are the "spoke"s I'm refering to.
Code:
SQL = "SELECT * FROM bible WHERE "

    ' Create our connection string
    strConn = GetConnectionString()
             Response.Write request.QueryString("book")
    If   request.QueryString("book")="Book" then

      Sql = Sql & "book LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If   request.QueryString("book_spoke")="Book_Spoke" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "book_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If   request.QueryString("book_title")="Book_Title" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "book_title LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If   request.QueryString("chapter")="Chapter" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "chapter LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if


    If   request.QueryString("chapter_spoke")="Chapter_Spoke" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "chapter_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If   request.QueryString("verse")="Verse" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "verse LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if

    If   request.QueryString("verse_spoke")="Verse_Spoke" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "verse_spoke LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if
    If   request.QueryString("text_data")="Text" then

      If iCounter > 0 Then
        Sql = Sql & " AND "
      End If

      Sql = Sql & "text_data LIKE '%" & Keyword & "%'"

      iCounter = iCounter + 1

    end if
  If Trim(Request.QueryString("recordType")) <> "" Then


  aRecTypes = Split(Request.QueryString("recordType"), ",")

  If IsArray(aRecTypes) Then 'This is a bit redundant, but it can't hurt
    SQL = SQL & " AND ("



    For iLoopCount = 0 To UBound(aRecTypes)
      If iLoopCount <> 0 Then
        SQL = SQL & " OR "
      End If

      SQL = SQL & " recordType = '" & trim(aRecTypes(iLoopCount)) & "'"
    Next
  End If
  SQL = SQL & ")"
End If





Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
Help..What am I doing wrong... Brettvan1 VB.NET 2002/2003 Basics 2 October 18th, 2004 02:36 AM
Where did I go wrong??? ahc2inc VB.NET 2002/2003 Basics 3 September 28th, 2004 08:19 PM
What's wrong?Help! amu BOOK: Beginning ASP.NET 1.0 1 October 28th, 2003 08:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.