Hi
My Code
<!-- #include file="connect.inc" -->
<!-- this file enables to RecordCount to correctly function -- >
<!--#include file="adovbs.inc"-->
<%
Session("Query") = Request.QueryString("query")
Call Header
Dim objConn
Dim objRec
Set objConn = Server.CreateObject ("ADODB.Connection")
Set objRec = Server.CreateObject ("ADODB.Recordset")
objConn.Open gsConnect
objRec.Open "webdata", objConn, adOpenStatic
objRec.MoveFirst
While Not objRec.EOF
'Response.Write objRec("id") & "<BR>"
objRec.MoveNext
Wend
'Response.Write "<b>Number = " & (objRec.RecordCount)
objRec.Close
objConn.Close
Set objRec = Nothing
Set objConn = Nothing
Sub Header
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>Search</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" >
<Font Face="Arial" Size="2">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2"></td>
</tr>
<tr>
<td width="50%" bgcolor="#000000">
<Form method="Get" id=form1 name=form1>
<table border="0" width="100%">
<tr>
<td width="33%" align="right"><font color="#FFFFFF" size="2" face="Tahoma,Arial"><b>Search for </b></font></td>
<td width="33%"><input type="text" size="20" value="<%=Request.QueryString("query")%>" name="query"></td>
<td width="34%"><input type="submit" name="Search" Value="Search"></td>
</tr>
</table>
</Form>
</td>
<td width="50%" bgcolor="#000000"></td>
</tr>
<tr>
<td width="100%" colspan="2" bgcolor="#000000"></td>
</tr>
</table>
<%
End Sub
If Trim(Session("Query")) <> "" Then
Search Request.QueryString ("query")
else
Response.Write "<b>Field empty</b>"
end if
Sub Search (searchstring)
if searchstring = "Gary" then
Response.Write "<b>whoopee</b>"
end if
End Sub
%>
</BODY>
</HTML>
Anyone tell me why Request.QueryString ("query") doesn't carry a value???
Gary




Reply With Quote