Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Engine issue 1

Status
Not open for further replies.

ebarratt

Programmer
Joined
Apr 10, 2002
Messages
53
Location
US
I've been staring at this for sometime and think it's time to pull back for a few and maybe ask for alittle help if anyone can spare a few seconds. I can't seem to get this code working:

<%
Session("frmSearch")=Request("txtSearch")
Session("frmSearchSize")= Len(Request("txtSearch"))
Session("SearchCategory") = 4
If Session("frmSearchSize") < 1 Then
Response.Redirect(" Else

Dim strAryWords(8)
Dim wordcount
Dim objConn, objRs, qry
Dim connectstr, sDSNDir
Dim dsn_name

dsn_name = "mysql_mgssearch.dsn"
sDSNDir = Server.MapPath("_dsn")
connectstr = "filedsn=" & sDSNDir & "\" & dsn_name
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open connectstr

qry = "SELECT * FROM DictMast WHERE SearchTerms = '" & Session("frmSearch") & "'"
Set objRs = objConn.Execute(qry)
if not objRs.EOF then
Session("SearchCategory") = objRs("MainCat")
else
Set objRs = nothing
wordcount = 0
if ( InStr(Session("frmSearch"), " ") <> Null ) AND ( InStr(Session("frmSearch"), " ") <> 0 )
strAryWords = Split(Session("frmSearch"), " ")
else
strAryWords(0) = Session("frmSearch")
end if
while ( Ubound(strAryWords) -1 ) >= wordcount
qry = "SELECT * From DictMast WHERE SearchTerms = '" & strAryWords(wordcount) & "'"
Set objRs = objConn.Execute(qry)
if not objRs.EOF then
Session("SearchCategory") = objRs("MainCat")
wordcount = 999
end if
wordcount = wordcount + 1
wend
end if
Set objRs = nothing

qry = "SELECT * From Affiliates Where MainCat=" & Session("SearchCategory")
Set objRs = objConn.Execute(qry)

End If
%>


Errol Barratt
 
whats the error that you are getting?

-DNG
 
How do I enable error reporting in asp? Just get the internal http 500 error.

Errol Barratt
 
go to tools->internet options->advanced-> then uncheck the box that says "Show HTTP friendly error messages"

and post the error you are getting...

-DNG
 
Thanks DNG,

Saved me alot of time now that I get error messages. Thanks for the advice.

Errol

Errol Barratt
 
not a problem...actual error messages will give us idea on what to fix :)

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top