want to create a search engine for small database, need help

I have PWS on my machine and wants to make a search engine for small database. Want your help give me an idea on which application I create my database and search engine.
parsaaliAsked:
Who is Participating?
 
MasseyMConnect With a Mentor Commented:
OK, Here ya go...

TheDB.DSN
----------------------
[ODBC]
DRIVER=Microsoft Access Driver (*.mdb)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=8
MaxBufferSize=512
ImplicitCommitSync=Yes
FIL=MS Access
DriverId=25


tdsn.asp
----------------------
<%
      sDB   = "TheDB2000.mdb"
      sScriptDir = "."
      sPath = Server.MapPath(sScriptDir) + "\"
      sDSN = "filedsn=" & sPath & "TheDB.Dsn;DefaultDir=" & sPath & ";DBQ=" & sPath & sDB & ";"


Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open sDSN, "", ""
%>


search.asp
----------------------
<!-- #Include File="tdsn.asp" -->
<%
Action = Request("Action")

If Action = "" then
      Response.write "<FORM ACTION=""search.asp"" METHOD=Post>"
      Response.write "Search String:<INPUT NAME=""SearchStr""><BR>"
      Response.write "<INPUT NAME=""Action"" VALUE=""Search"" TYPE=""SUBMIT"">"
      Response.write "</FORM>"
Elseif Action = "Search" then
      Set SearchRS = Server.CreateObject("ADODB.RecordSet")
      SearchStr = Request("SearchStr")
      SQL = "SELECT * FROM Customers WHERE ContactFirstName LIKE '%" & SearchStr & "%' OR ContactLastName LIKE '%" & SearchStr & "%';"

      SearchRS.OPen SQL, Conn, 3, 3
      RC = SearchRS.RecordCount
      If RC > 0 then ' YOu have records!
      Response.write "Located " & RC & " total Record(s)<BR>"
        Do While NOT SearchRS.EOF
          Response.write SearchRS("ContactLastName") & ", " & SearchRS("ContactFirstName") & "&nbsp;&nbsp;" & SearchRS("PhoneNumber") & "<BR>"
        SearchRs.MoveNext
        Loop
      Else
        response.Write "No records Found"
      End If
      SearchRS.Close
      Set SearchRS = nothing
End If
      ' Opened in the TDSN page...
      Conn.Close
      Set Conn = nothing
%>
0
 
parsaaliAuthor Commented:
Edited text of question.
0
 
MasseyMCommented:
Use ASP...  Very simple.

What is your database structure?  What do the fields contain and what are their names?  

if you like, you cna send the database to files@mrqcorp.com and I will put together a very quick and simple search engine for you...
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
rdivilbissCommented:
Post the answer please MasseyM.  (For us ASP newbies <g>.)
0
 
MasseyMCommented:
I would, but there are many files... give me your email and I will send itto you...

mail me at masseym@mrqcorp.com
0
 
rdivilbissCommented:
rdivilbiss@cssnetworks.com

0
 
parsaaliAuthor Commented:
MasseyM
Hi, is it possible to you to just discribe it i am a newbies I don't know about ASP. Should I have to download some program.
0
 
MasseyMCommented:
If you already have a database, that would make it 5000 times easier...

I suppose I can post something that already has been done... This is VERY simplistic

Basically, You have a HTML form that has a textbox called "SearchStr" and a submit button named "Action" with a value of "Search".  Have <FORM ACTION="search.asp" METHOD=POST>


You have a Database that has three fields in a table called "Links".
1) LinkID   - Autonumber
2) Link     - Text (255)
3) Desc     - Memo



search.asp
--------------
<%
Set SearchConn = Server.CreateObject("ADODB.Connection")
SearchConn.Open "yourdsn", "", ""
Set SearchRS = Server.CreateObjecct("ADODB.RecordSet")
SQL = "SELECT * FROM Links WHERE Desc LIKE'%" & Request("SearchStr") & "%' ORDER BY Desc;"
SearchRS.OPen SQL, SearchConn, 3, 3
RC = SearcRs.RecordCount
If RC > 0 then ' YOu have records!
  Do While NOT SearchRS.EOF
    Response.write "<A HREF=""" & SearchRS("Link") & """>" & SearchRS("Desc") & "</A><BR>"
  SearchRs.MoveNext
  Loop
Else
  response.Write "No records Found"
End If
SearchRS.Close
Set SearchRS = nothing
SearchConn.Close
Set SearchConn = nothing
%>

Now, you can add additionanl capabilities such as what fields to search, add paging (page 1 of 10), etc...
0
 
MasseyMCommented:
If you already have a database, that would make it 5000 times easier...

I suppose I can post something that already has been done... This is VERY simplistic

Basically, You have a HTML form that has a textbox called "SearchStr" and a submit button named "Action" with a value of "Search".  Have <FORM ACTION="search.asp" METHOD=POST>


You have a Database that has three fields in a table called "Links".
1) LinkID   - Autonumber
2) Link     - Text (255)
3) Desc     - Memo



search.asp
--------------
<%
Set SearchConn = Server.CreateObject("ADODB.Connection")
SearchConn.Open "yourdsn", "", ""
Set SearchRS = Server.CreateObjecct("ADODB.RecordSet")
SQL = "SELECT * FROM Links WHERE Desc LIKE'%" & Request("SearchStr") & "%' ORDER BY Desc;"
SearchRS.OPen SQL, SearchConn, 3, 3
RC = SearcRs.RecordCount
If RC > 0 then ' YOu have records!
  Do While NOT SearchRS.EOF
    Response.write "<A HREF=""" & SearchRS("Link") & """>" & SearchRS("Desc") & "</A><BR>"
  SearchRs.MoveNext
  Loop
Else
  response.Write "No records Found"
End If
SearchRS.Close
Set SearchRS = nothing
SearchConn.Close
Set SearchConn = nothing
%>

Now, you can add additionanl capabilities such as what fields to search, add paging (page 1 of 10), etc...
0
 
parsaaliAuthor Commented:
Sorry MesseyM I am a newbies need more your help. Please tell me where should I put this program and I mean should I add this program in my HTML form program. Pl give me some idea. I have a HTML form program. Also I made my database in MS ACCESS. what program should I used for searching my database. And from where that program be loaded. Is that program is in HTML?
If possible send me some files you mention on your comments
my email address    pasrsaali@hotmail.com
Thanks
0
 
MasseyMCommented:
The above code does all the work for you... Can you email me the Access database that you want searched?  Please mail it to me at files@mrqcorp.com and I will customize the above code to fit your database and then you can decide if you want the others to have a copy as well...
0
 
parsaaliAuthor Commented:
Hi MesseyM
I email you my database file on your eamil address files@mrqcorp.com
Pl. tell me also how its will works.
Thanks
0
 
parsaaliAuthor Commented:
Hi MessyM
You didn't reply since long time. I wainting for your reply.
0
 
MasseyMCommented:
You didn't receive the email back?  My apologies... I sent it about 3 days ago...

I will send again later tonight or tomorrow morning when I get home...
0
 
parsaaliAuthor Commented:
Still not recevied any email my email address is parsaali@netscape.net.
I hope you will send it soon.
0
All Courses

From novice to tech pro — start learning today.