Seaching a database
| Author | Topic |
|---|---|
| Mark Capric Member Joined: 16 Aug 2004 Country: Posts: 2 | Posted: 16 Aug 2004 17:03:38 I need some major help on a project I'm trying to start with. I have an MS Access DB, I want to be able to have a html search engine that searches through the DB and then displays the results on another html page. Can someone tell me where I can started? Thanks for any help you can give.I need some major help on a project I'm trying to start with. I have an MS Access DB, I want to be able to have a html search engine that searches through the DB and then displays the results on another html page. Can someone tell me where I can started? Thanks for any help you can give. |
| Dave Thomas Zone Administrator ![]() Joined: 02 Jul 2002 Country: United Kingdom Posts: 1,216 | Posted: 16 Aug 2004 22:39:54 its not as hard as it sounds to do a search. its when you want to highlight and rank searches that it gets complicated. its not as hard as it sounds to do a search. its when you want to highlight and rank searches that it gets complicated.basically you'll need a table in your database to search, but what is it your searching for? a title, something in the description, keywords??? you basically create a form with a textfield and a go button. call the textfield 'txtSearch' and have the action of the form set to 'search_results.asp' or something similiar. thats the first bit done. now open 'search_results.asp' and create a recordset. You'll need to go into advanced SQL. depending on what your searching for it will be along the lines of. <pre id=code><font face=courier size=2 id=code> SELECT * FROM tblArticles WHERE ArticleTitle LIKE '%" + Replace(rsNews__MMColParam, "'", "''" </font id=code></pre id=code> MMColParam is created by adding a varibale in the box with the value and run time string options and adding. value = % runtime string = Request.Form("txtSearch" when that is set up, you add the data to the page via a table or whatever from the bindings panel, and you have a working search. btw the % sign is a wildcard, there are a lot of ways to search for something, my example is just a basic search. Regards, Dave [DWMX 2004]|[FlashMX 2004 Pro]|[SQL]|[Access2000]|[ASP/VBScript]|[XP-Pro] |
Posted: 16 Aug 2004 17:03:38











