it's no problem at all. i'll write a quick example... i can't guarentee that it'll have zero errors, but it'll give u the idea
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.provider = "Microsoft.Jet.OLEDB.4.0" 'access 2000 database
conn.open "c:\mydatabase.mdb" 'database path
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset") 'create a recordset
rs.open "SELECT * FROM [tblCount] WHERE searchterm = '" & Request.QueryString("searchterm") & "';", conn 'open up a recordset
'If it found a record with the search term then that means
'it's already been searched, if it didn't, it's a new term
If rs.EOF and rs.BOF then
'it's a new term, add it to the database
conn.execute("INSERT INTO tblCount (term, counted) VALUES ('" & Request.QueryString("searchterm") & "', '1');")
Else
'it's already been searched
rs.movefirst
Dim varCount
varCount = rs.fields("counted")
varCount = varCount + 1
conn.execute("UPDATE tblCount SET counted = '" & varCount & "' WHERE term = '" & Request.QueryString("searchterm") & "';")
End If
'clean up
Set rs = NOTHING
conn.close
Set conn = NOTHING
%>
change the necessary things in the script. put this in your search script (as long as your search term is under "searchterm" in the querystring... if not then change it)
on your homepage, put something like this where you want to display your top 5 results...
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.provider = "Microsoft.Jet.OLEDB.4.0"
conn.open "c:\mydatabase.mdb"
Dim rs
Set rs = Server.CreateObject("ADODB.recordset")
rs.open "SELECT * FROM tblCount ORDER BY counted DESC", conn
Dim i
i = 5
While i > 0
Response.Write rs.fields("term")
Response.Write "<br>"
i = i - 1
rs.movenext
Wend
'clean up
conn.close
Set conn = NOTHING
Set rs = NOTHING
%>