Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 10th, 2004, 02:01 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default how to use recordType in htm/asp

What I have is a table which one of the 10 fields is called "recordType".

I have in my htm two radio buttons for enabling/disabling 66 checkboxes. So far that works.

But the 66 checkboxes all have "value="recordType"" and name=recordType names. The names are listed:

Code:
<SCRIPT LANGUAGE=Javascript>

  function disable(OnOff) {
  var f = kjbible;
 
    f.gn.disabled=OnOff;
    f.is.disabled=OnOff;
    f.ro.disabled=OnOff;

    f.ex.disabled=OnOff;
    f.je.disabled=OnOff;
    f.co.disabled=OnOff;

    f.lv.disabled=OnOff;
    f.la.disabled=OnOff;
    f.ci.disabled=OnOff;

    f.nu.disabled=OnOff;
    f.ez.disabled=OnOff;
    f.ga.disabled=OnOff;

    f.de.disabled=OnOff;
    f.da.disabled=OnOff;
    f.ep.disabled=OnOff;


    f.js.disabled=OnOff;
    f.ho.disabled=OnOff;
    f.ph.disabled=OnOff;


    f.jg.disabled=OnOff;
    f.jl.disabled=OnOff;
    f.cl.disabled=OnOff;


    f.ru.disabled=OnOff;
    f.am.disabled=OnOff;
    f.th.disabled=OnOff;


    f.sa.disabled=OnOff;
    f.ob.disabled=OnOff;
    f.te.disabled=OnOff;

    f.sm.disabled=OnOff;
    f.jh.disabled=OnOff;
    f.ti.disabled=OnOff;

    f.ki.disabled=OnOff;
    f.mi.disabled=OnOff;
    f.tm.disabled=OnOff;


    f.kn.disabled=OnOff;
    f.na.disabled=OnOff;
    f.tt.disabled=OnOff;


    f.ch.disabled=OnOff;
    f.hb.disabled=OnOff;
    f.pl.disabled=OnOff;

    f.cr.disabled=OnOff;
    f.ze.disabled=OnOff;
    f.he.disabled=OnOff;

    f.ea.disabled=OnOff;
    f.ha.disabled=OnOff;
    f.ja.disabled=OnOff;

    f.ne.disabled=OnOff;
    f.zc.disabled=OnOff;
    f.pe.disabled=OnOff;    

    f.es.disabled=OnOff;
    f.ml.disabled=OnOff;
    f.pt.disabled=OnOff;

    f.jb.disabled=OnOff;
    f.mt.disabled=OnOff;
    f.jn.disabled=OnOff;    

    f.ps.disabled=OnOff;
    f.mk.disabled=OnOff;
    f.jnn.disabled=OnOff;

    f.pr.disabled=OnOff;
    f.lk.disabled=OnOff;
    f.jhn.disabled=OnOff;


    f.ec.disabled=OnOff;
    f.jo.disabled=OnOff;
    f.ju.disabled=OnOff;


    f.so.disabled=OnOff;
    f.ac.disabled=OnOff;
    f.re.disabled=OnOff;

}
</SCRIPT>
Example:
Code:
   <td width="33%" height="19">  
<input TYPE="checkbox" NAME="gn" CHECKED VALUE="recordType">Genesis</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="is" CHECKED VALUE="recordType">Isaiah</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="ro" CHECKED VALUE="recordType">Romans</td>
  </tr>
My goal is to check some of the checkboxes (after enabling the checkbox table through the radio buttons) and search a keyword in that range(s) only. Example. Above are three names gn, is, ro. If I select "gn" only I want the keyword to be searched in the "gn" records ONLY. Or if I select "gn" and "is" only I want the keyword to be searched in the "gn" and "is" records ONLY.

Is there a way to attach my htm and asp pages with a small portion of my database so that you may verify?

Reply With Quote
  #2 (permalink)  
Old August 10th, 2004, 08:29 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Mentiri, Muara, Brunei.
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

  Instead of checking names, you can have value of checkbox as "gn", "is", "ro". What is the need(use) of having same value for all checkboxes? Instead...

<input type="checkbox" name="chkGN" value="gn">Genesis
<input type="checkbox" name="chkIS" value="is">Isaiah

When you submit this form the checkbox values are retrieved. Whatever you check the checkbox those values only be retrieved.



Reply With Quote
  #3 (permalink)  
Old August 10th, 2004, 09:21 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok so I changed the name with the value:

Example:
Code:
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="gn" CHECKED >Genesis</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="is" CHECKED >Isaiah</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ro" CHECKED >Romans</td>
  </tr>


But when I click the radio button to enable/disable the checkboxes it says:
 
Quote:
quote:line: 61
Quote:
Error: 'gn' is null or not an object
Reply With Quote
  #4 (permalink)  
Old August 10th, 2004, 10:51 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

gilgalbiblewheel,

Why do you have to write such long code and complicate things.

It is so easy as this. Try this. Copy/paste this code and paste in a new html/asp file, open that in a browser to see how it behaves and use this functionality in your code.
Code:
<html>
<head>
<script language="javascript">
function EnableDisable()
{
    if(document.frm.optAction[0].checked)
        for(i=0;i<document.frm.chk.length;i++)
            document.frm.chk[i].disabled=false;

    if(document.frm.optAction[1].checked)
        for(i=0;i<document.frm.chk.length;i++)
            document.frm.chk[i].disabled=true;
}

</script>
</head>
<body>
<form name="frm" action="" method="post">
    <input type="radio" name="optAction" CHECKED onclick="Javascript:EnableDisable();">Enable
    <input type="radio" name="optAction" onclick="javascript:EnableDisable();">Disable
    <br>
    <input type="checkbox" name="chk" value="1">1<br>
    <input type="checkbox" name="chk" value="2">2<br>
    <input type="checkbox" name="chk" value="3">3<br>
    <input type="checkbox" name="chk" value="4">4
</form>
</body>

</html>
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #5 (permalink)  
Old August 10th, 2004, 11:15 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

OK thanks. Will it be possible to use the radio button to enable one checkbox while disabling another checkbox? If possible it would be necessary because in one area I have 3 different types of checkboxes, like search: book#, book Name , and another type of book #. But if I select the books (from 66 books in records in one table)I have to disable the first 3 checkboxes.

Reply With Quote
  #6 (permalink)  
Old August 10th, 2004, 11:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes it is possible. Name those three checkboxes alone with same name and use the same logic I posted in my previous post. Or If you want to use different name for those three check boxes, then use

document.<formname>.<checkboxname>.disabled = true (for disable)
document.<formname>.<checkboxname>.disabled = false (for enable)

where you should use the formname and checkboxname as you defined in your code.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #7 (permalink)  
Old August 11th, 2004, 12:04 AM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok. This is how I did it. But is there a way to get a set of checkboxes disable as I open the page or refresh it?

Code:
<html>
<head>
<script language="javascript">
function EnableDisable()
{
    if(document.frm.optAction[0].checked)
        for(i=0;i<document.frm.chk.length;i++)
            document.frm.chk[i].disabled=false;
    if(document.frm.optAction[0].checked)
        for(i=0;i<document.frm.nochk.length;i++)
            document.frm.nochk[i].disabled=true;


    if(document.frm.optAction[1].checked)
        for(i=0;i<document.frm.chk.length;i++)
            document.frm.chk[i].disabled=true;
    if(document.frm.optAction[1].checked)
        for(i=0;i<document.frm.nochk.length;i++)
            document.frm.nochk[i].disabled=false;

}

</script>
</head>
<body>
<form name="frm" action="" method="post">
    <input type="radio" name="optAction" CHECKED onclick="Javascript:EnableDisable();">Enable
    <input type="radio" name="optAction" onclick="javascript:EnableDisable();">Disable
    <br>
    <input type="checkbox" name="chk" value="1">1<br>
    <input type="checkbox" name="chk" value="2">2<br>
    <input type="checkbox" name="chk" value="3">3<br>
    <input type="checkbox" name="chk" value="4">4<br><br>
    <input type="checkbox" name="nochk" value="5">5<br>
    <input type="checkbox" name="nochk" value="6">6<br>
    <input type="checkbox" name="nochk" value="7">7<br>
    <input type="checkbox" name="nochk" value="8">8
</form>
</body>

</html>
Reply With Quote
  #8 (permalink)  
Old August 11th, 2004, 12:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Write a function that disables the set of checkboxes and call it in Body Onload. This will execute the function everytime the page is refreshed/loaded.

<body Onload="Javascript:YourfunctiontoDisableCheckBoxes ();">

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #9 (permalink)  
Old August 11th, 2004, 12:02 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

For some reason this doesn't work entirely:
See note at the end.
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Search for the Bible</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=true;
    if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book.length;i++)
            document.kjbible.book[i].disabled=false;
    if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book_spoke.length;i++)
            document.kjbible.book_spoke[i].disabled=false;
    if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book_title.length;i++)
            document.kjbible.book_title[i].disabled=false;

    if(document.kjbible.optAction[1].checked)
        for(i=0;i<document.kjbible.recordType.length;i++)
            document.kjbible.recordType[i].disabled=false;
   if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book.length;i++)
            document.kjbible.book[i].disabled=true;
    if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book_spoke.length;i++)
            document.kjbible.book_spoke[i].disabled=true;
    if(document.kjbible.optAction[0].checked)
        for(i=0;i<document.kjbible.book_title.length;i++)
            document.kjbible.book_title[i].disabled=true;
}

</script>
</head>
<body Onload="Javascript:EnableDisable();">
<fieldset>
<legend>
Biblewheel:
</legend>
<tr>
<form name="kjbible" action="amos.asp" method="get">
Search for:
<input type="text" name="Keyword">
<input type="submit" value="Submit"><input type="reset">
</td>
    <br>
    <input type="radio" name="optAction" CHECKED onclick="Javascript:EnableDisable();">Enable The entire King James Bible 
    <input type="radio" name="optAction" onclick="javascript:EnableDisable();">Disable Your selection of books
    <br>

<br>
<input type="checkbox" name="book" VALUE="yes">
Book
<br>
<input type="checkbox" name="book_spoke" VALUE="yes">
Book Spoke
<br>
<input type="checkbox" name="book_title" VALUE="yes">
Book Title
<br>
<input type="checkbox" name="chapter" VALUE="yes">
Chapter
<br>
<input type="checkbox" name="chapter_spoke" VALUE="yes">
Chapter Spoke
<br>
<input type="checkbox" name="verse" VALUE="yes">
Verse
<br>
<input type="checkbox" name="verse_spoke" VALUE="yes">
Verse Spoke
<br>
<input type="checkbox" name="text_data" VALUE="yes">
Text
 </tr>
 <fieldset>
<legend>
Search:
</legend>

     <p>Where do you want to search?</p> 
    <table border="1" width="100%" height="500">
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="gn" CHECKED >Genesis</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="is" CHECKED >Isaiah</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ro" CHECKED >Romans</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ex" >Exodus</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="je" >Jeremiah</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="co" >1 Corinthians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="lv" >Leviticus</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="la" >Lamentations</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ci" >2 Corinthians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="nu" >Numbers</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ez" >Ezekiel</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ga" >Galatians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="de" >Deuteronomy</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="da" >Daniel</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ep" >Ephesians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="js" >Joshua</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ho" >Hosea</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ph" >Philippians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="jg" >Judges</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jl" >Joel</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="cl" >Colossians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ru" >Ruth</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="am" >Amos</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="th" >1 Thessalonians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="sa" >1 Samuel</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ob" >Obadiah
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="te" >2 Thessalonians</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="sm" >2 Samuel</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jh" >Jonah
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ti" >1 Timothy</td>
  </tr>
  <tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ki" >1 Kings</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="mi" >Micah
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="tm" >2 Timothy</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="kn" >2 Kings</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="na" >Nahum
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="tt" >Titus</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ch" >1 Chronicles</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="hb" >Habakkuk
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="pl" >Philemon</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="cr" >2 Chronicles</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ze" >Zepheniah
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="he" >Hebrews</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ea" >Ezra</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ha" >Haggai
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ja" >James</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ne" >Nehemiah</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="zc" >Zechariah
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="pe" >1 Peter</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="es" >Esther</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ml" >Malachi
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="pt" >2 Peter</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="jb" >Job</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="mt" >Matthew
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jn" >1 John</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ps" >Psalms</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="mk" >Mark
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jnn" >2 John</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="pr" >Proverbs</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="lk" >Luke
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jhn" >3 John</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="ec" >Ecclesiastes</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="jo" >John
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ju" >Jude</td>
  </tr>
    <td width="33%" height="19">  
<input TYPE="checkbox" NAME="recordType" VALUE="so" >Song of Solomon</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="ac" >Acts
</td>
<td width="33%" height="19">
<input TYPE="checkbox" NAME="recordType" VALUE="re">Revelation</td>
  </tr>
</table>
</fieldset>
</form>
</fieldset>
</body>
</html>
I don't think I can change those three names into one name because each represents a field in database table.

Reply With Quote
  #10 (permalink)  
Old August 11th, 2004, 04:31 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

1.
Code:
SELECT * FROM bible WHERE text_data LIKE '%adam%' OR ( recordType = 'gn' AND recordType = ' is' AND recordType = ' ro')
Searches the entire table of the database

2.
Code:
SELECT * FROM bible WHERE text_data LIKE '%adam%' AND ( recordType = 'gn' AND recordType = ' is' AND recordType = ' ro')
"We did not find a match!"

3.
Code:
SELECT * FROM bible WHERE text_data LIKE '%adam%' AND ( recordType = 'gn' OR recordType = ' is' OR recordType = ' ro')
Searches the first recordType only

4.
Code:
SELECT * FROM bible WHERE text_data LIKE '%adam%' OR ( recordType = 'gn' OR recordType = ' is' OR recordType = ' ro')
Displays every record found in the 1st recordType, then searches for the keyword in the rest of the table.

I don't understand why.

How can I eliminate the spaces between ' and is in ' is' and ' ro' ?


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

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

  SQL = SQL & ")"
End If

Response.Write SQL

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload_image.htm Chapter 7 jeroen BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 September 3rd, 2009 11:53 AM
Batch convert .htm pages to .asp using template karib Dreamweaver (all versions) 22 July 30th, 2007 04:17 PM
Question on NameSpaceBooks.htm manahual BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 September 20th, 2006 10:42 AM
How can i rewrite the example bookClient.htm Keyne XML 0 August 23rd, 2006 07:11 AM
App_Offline.htm won't allow me to test. VictorVictor BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 March 2nd, 2006 10:46 AM



All times are GMT -4. The time now is 10:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.