PDA

View Full Version : In ASP, how can u search multiple tables in MS Access?


silab
10-23-2002, 02:17 PM
Can u guys pls give me idea.

Right now I have 3 tables in my access database. In an ASP page, there is one simple search textbox which is suppose to look at 3 tables in my database (one memo field, named all the same for those 3 tables). The search is suppose to return the record with a partial or full search for example.

I searched the killer

it will return any records with only "the" or only "killer" or both, or even with only the word "kill". The search will look at 3 tables.

Do any of you guys know how this should be coded? I am really left with no clue :(

Thanks guys

raf
10-23-2002, 03:34 PM
silab,
that are two question.
a. search in three tables: as far as i know, you'll need to perform 3 searches (unless you can join the tables), creating 3 recordsets.
normally, those searches go pretty fast, so you won't notice the timedifference between 1 or 3 selects. Unless you've got a huge database, buth then you probably will have a good databasedesign, and you'll be able to join the tables

b. what keywords.
thats something for you to decide. buth you need to make a choice when coding the pages.
i always use the "or" option.
here's a thread with a good code for a searchfunction
http://www.codingforums.com/showthread.php?s=&threadid=7976

(using 'or' buth you can replace the 'or' by 'and'. You could place radiobuttons in your searchform were the user can choose between 'or' and 'and' and then use a variable in the script instead of 'OR'.)

using only part of a word. hmm, that's tricky. I know how to use part of a word, buth of coarse, you'll get a lot of rubbish, and i don't think it would be a userfriendly way to go.

silab
10-23-2002, 11:57 PM
Thanks raf, will play with it :)

whammy
10-24-2002, 12:43 AM
If I were you I'd look up some "relational database tutorials" though... since that is a really good way to handle data. :D