Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: search


Message #1 by Jean Halstad <J_Halstad@S...> on Fri, 26 Apr 2002 11:00:13 +0100
Have set up a simple search page. I don't get any errors, but nothing is
returned. Am using SQL 6.5 and NT 4. Can anyone give me some ideas about
what to do next?

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<metadata type="typelib" file="C:\program files\common
files\system\ado\msado15.dll"-->
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>

<%
dim cn 'connection string
dim strSearch
dim strConn
dim rs
dim query

'Create & Open data connection
set cn=server.createobject("ADODB.Connection")
strConn = "Provider=MSIDXS; Data Source=web"
cn.open Session("intranet_ConnectionString")
'Create & Open recordset
set rs=server.createobject("ADODB.Recordset")
'Construct search string
strSearch = "select docTitle, path, fileName, characterization, size" &_
" from scope()" &_
" where contains ('" & request.form("txtSearchFor") & "')"
response.write strSearch
rs.open strSearch, strConn
if rs.eof then
response.write "No entries found"
else
while not rs.eof
response.write "<span class='p2'>" &_
rs("docTitle") & "</span><br>" &_
rs("characterization") & "<br>" &_
"<a href='" & rs("path") & "'>" &_
rs("FileName") & "</a>" &_
" (" & rs("size") & " bytes)<p>"
rs.movenext
wend
end if
rs.close
set rs = Nothing
%>
</BODY>
</HTML>

		    *******SEAFOOD WEEK*******
			4 to 11 October 2002
		to register your interest contact us on
		       seafoodweek@s...

***************************************************************************
This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed
If you have received this e-mail in error please notify
seafish@s...

If the content is not about the business of the Sea Fish Industry Authority
or the sea fish industry then the message is neither from nor sanctioned
by the Sea Fish Industry Authority.

  Return to Index