i m making search by field but problem is that on page load it will display all records from database.... i want to stop it... plz... guide me....

my code is given below :
Code:
search.asp
========
<%@ Language=VBScript %>
<!-- METADATA TYPE="typelib" UUID="00000200-0000-0010-8000-00AA006D2EA4" NAME="ADO Type Library"-->

<%
Option Explicit
Response.Buffer = True		'Turn buffering on
Response.Expires = -1		'Page expires immediately

'Constants
Const MIN_PAGESIZE = 5		'Minimum pagesize
Const MAX_PAGESIZE = 20		'Maximum pagesize
Const DEF_PAGESIZE = 10		'Default pagesize

'Variables
Dim objCn					'ADO DB connection object
Dim objRs					'ADO DB recordset object
Dim blnWhere				'True/False for have WHERE in sql already
Dim intRecord				'Current record for paging recordset
Dim intPage					'Requested page
Dim intPageSize				'Requested pagesize
Dim sql						'Dynamic sql query string

'Create objects
Set objCn = Server.CreateObject("ADODB.Connection")
Set objRs = Server.CreateObject("ADODB.Recordset")

'Set/initialize variables
intRecord = 1
blnWhere = False

'-Get/set requested page
intPage = MakeLong(Request("page"))
If intPage < 1 Then intPage = 1

'-Get/set requested pagesize
If IsEmpty(Request("pagesize")) Then	'Set to default
	intPageSize = DEF_PAGESIZE
Else
	intPageSize = MakeLong(Request("pagesize"))
	'Make sure it fits our min/max requirements	
	If intPageSize < MIN_PAGESIZE Then
		intPageSize = MIN_PAGESIZE
	ElseIf intPageSize > MAX_PAGESIZE Then
		intPageSize = MAX_PAGESIZE
	End If
End If

'-Build dynamic sql
'sql = "SELECT memberid, name, email, age FROM profile "
sql = "SELECT memberid, name, dd, mm, yy, height, weight, mothertongue,religion,caste,manglik,education,occupation,age,maritalstatus,address,email,gender FROM profile "

'--ID (exact search only)
'If Not IsEmpty(Request("id")) Then
	'If IsNumeric(Request("id")) Then
		'Add to query
		'First item so we don't have to test for WHERE
		'blnWhere = True 'Set where to true
		'sql = sql & "WHERE "
		'sql = sql & "(memberid = " & CStr(CLng(Request("id"))) & ") "
	'End If
'End If

'--Sku (partial and exact search)
If Not IsEmpty(Request("sku")) Then
	Dim strSku
	strSku = Trim(Request("sku"))
	
	If strSku <> "" Then
		'Test for WHERE
		If blnWhere Then sql = sql & "AND " Else sql = sql & "WHERE " : blnWhere = True
		
		If (Left(strSku, 1) = "*" And Len(strSku) > 1) Then	'Partial search
			sql = sql & "(gender LIKE '%" & Replace(Mid(strSku, 2), "'", "''") & "') "	
		ElseIf (Right(strSku, 1) = "*" And Len(strSku) > 1) Then	'Partial search
			sql = sql & "(gender LIKE '" & Replace(Mid(strSku, 1, Len(strSku)-1), "'", "''") & "%') "	
		Else	'Exact match
			sql = sql & "(gender = '" & Replace(strSku, "'", "''") & "') "
		End If

	End If
End If

'--Title (parital search only)
If Not IsEmpty(Request("title")) Then
	Dim strTitle
	strTitle = Trim(Request("title"))
	
	If strTitle <> "" Then
		'Test for WHERE
		If blnWhere Then sql = sql & "AND " Else sql = sql & "WHERE " : blnWhere = True
		sql = sql & "(caste LIKE '%" & Replace(strTitle, "'", "''") & "%') "
	End If
End If

'--religion (parital search only)
If Not IsEmpty(Request("religion")) Then
	Dim strreligion
	strreligion = Trim(Request("religion"))
	
	If strreligion <> "" Then
		'Test for WHERE
		If blnWhere Then sql = sql & "AND " Else sql = sql & "WHERE " : blnWhere = True
		sql = sql & "(religion LIKE '%" & Replace(strreligion, "'", "''") & "%') "
	End If
End If
'--Price (minimum)
If Not IsEmpty(Request("minprice")) Then
	If IsNumeric(Request("minprice")) Then
		Dim dblMinPrice
		dblMinPrice = Cstr(Request("minprice"))

		'Test for WHERE
		If blnWhere Then sql = sql & "AND " Else sql = sql & "WHERE " : blnWhere = True
		sql	= sql & "(age >= " & CStr(dblMinPrice) & ") "
	End If
End If
		
'--Price (maximum)
If Not IsEmpty(Request("maxprice")) Then
	If IsNumeric(Request("maxprice")) Then
		Dim dblMaxPrice
		dblMaxPrice = Cstr(Request("maxprice"))

		'Test for WHERE
		If blnWhere Then sql = sql & "AND " Else sql = sql & "WHERE " : blnWhere = True
		sql	= sql & "(age <= " & CStr(dblMaxPrice) & ") "
	End If
End If

'--Sort By Field
sql = sql & "ORDER BY "
Select Case Trim(LCase(Request("sortby")))
	Case "name":		sql = sql & "name "
	Case "email":	sql = sql & "email "
	Case "age":	sql = sql & "age "
	Case Else:		sql = sql & "memberID "
End Select

'--Sort Order
Select Case Trim(LCase(Request("sortorder")))
	Case "desc":	sql = sql & "DESC"
	Case Else:		sql = sql & "ASC"
End Select
'--Dynamic sql finished

'Create and open connection object
With objCn
	.CursorLocation = adUseClient
	.ConnectionTimeout = 15
	.CommandTimeout = 30
	.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
						"Data Source=" & Server.MapPath("Aaditya.mdb") & ";"
	.Open
End With

'Create and open recordset object
With objRs
	.ActiveConnection = objCn
	.CursorLocation = adUseClient
	.CursorType = adOpenForwardOnly
	.LockType = adLockReadOnly
	.Source = sql
	.PageSize = intPageSize
	.Open
	Set .ActiveConnection = Nothing	'Disconnect the recordset
End With

'Creates a long value from a variant, invalid always set to zero
Function MakeLong(ByVal varValue)
	If IsNumeric(varValue) Then
		MakeLong = CLng(varValue)
	Else
		MakeLong = 0
	End If
End Function

'Returns a neatly made paging string, automatically configuring for request
'variables, regardless of in querystring or from form, adjust output to your needs.
Function Paging(ByVal intPage, ByVal intPageCount, ByVal intRecordCount)
	Dim strQueryString
	Dim strScript
	Dim intStart
	Dim intEnd
	Dim strRet
	Dim i

	If intPage > intPageCount Then
		intPage = intPageCount
	ElseIf intPage < 1 Then 
		intPage = 1
	End If
	
	If intRecordCount = 0 Then
		strRet = "No Records Found"
	ElseIf intPageCount = 1 Then
		strRet = "End Of Hits"
	Else
		For i = 1 To Request.QueryString.Count
			If LCase(Request.QueryString.Key(i)) <> "page" Then
				strQueryString = strQueryString & "&" 
				strQueryString = strQueryString & Server.URLEncode(Request.QueryString.Key(i)) & "=" 
				strQueryString = strQueryString & Server.URLEncode(Request.QueryString.Item(i))
			End If
		Next

		For i = 1 To Request.Form.Count
			If LCase(Request.Form.Key(i)) <> "page" Then
				strQueryString = strQueryString & "&" 
				strQueryString = strQueryString & Server.URLEncode(Request.Form.Key(i)) & "=" 
				strQueryString = strQueryString & Server.URLEncode(Request.Form.Item(i))
			End If
		Next

		If Len(strQueryString) <> 0 Then
			strQueryString = "?" & Mid(strQueryString, 2) & "&"
		Else
			strQueryString = "?"
		End If

		strScript = Request.ServerVariables("SCRIPT_NAME") & strQueryString
	
		If intPage <= 10 Then
			intStart = 1
		Else
			If (intPage Mod 10) = 0 Then
				intStart = intPage - 9
			Else
				intStart = intPage - (intPage Mod 10) + 1
			End If
		End If

		intEnd = intStart + 9
		If intEnd > intPageCount Then intEnd = intPageCount
	
		strRet = "Page " & intPage & " of " & intPageCount & ": "
	
		If intPage <> 1 Then 
			strRet = strRet & "<a href=""" & strScript
			strRet = strRet & "page=" & intPage - 1 
			strRet = strRet & """>&lt;&lt;Prev</a> "
		End If
	
		For i = intStart To intEnd
			If i = intPage Then
				strRet = strRet & "<b>" & i & "</b> "
			Else
				strRet = strRet & "<a href=""" & strScript
				strRet = strRet & "page=" & i 
				strRet = strRet & """>" & i & "</a>"
				If i <> intEnd Then strRet = strRet & " "
			End If
		Next
	
		If intPage <> intPageCount Then
			strRet = strRet & " <a href=""" & strScript
			strRet = strRet & "page=" & intPage + 1 
			strRet = strRet & """>Next&gt;&gt;</a> "
		End If
	End If
	
	Paging = strRet
End Function
%>
Code:
html
=====
<body onload="">

<div id="Layer1" style="position:absolute; left:0; top:180; width:780; height:219px; z-index:1">
  <table width="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="ffcc99">
    <tr>
      <td align=center><h3 class="style1">Search Your Partner </h3></td>
    </tr>
    <tr>
      <td align=center>&nbsp;</td>
    </tr>
    <tr>
      <td><hr></td>
    </tr>
    <!--Search Form-->
    <form name="frmSearch" method="post" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
      <input type="hidden" name="page" value="1">
      <tr>
        <td align=center><table width="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="996699">
            <tr>
              <td colspan="2"><span class="style2"><font size="3"> Searching Options</font></span></td>
            </tr>
            <tr>
              <td nowrap>&nbsp;</td>
              <td width="100%">&nbsp;</td>
            </tr>
            <tr>
              <td nowrap><strong class="v11r">Looking For: </strong></td>
              <td width="100%"><input name="sku" type="text" id="sku" accesskey="s" value="<%=Server.HTMLEncode(Request("name"))%>" size="20">
                  <br>
              (Male / Female) </td>
            </tr>
            <tr>
              <td nowrap class="v11g"><strong class="v11r">Caste :</strong><strong></strong></td>
              <td width="100%"><input accesskey="t" type="text" name="title" size="20" value="<%=Server.HTMLEncode(Request("email"))%>">
  &nbsp;<span class="style1">(partial match)</span></td>
            </tr>
            <tr>
              <td nowrap class="v11r"><strong class="v11r">Religion</strong>:</td>
              <td><input name="religion" type="text" id="religion" accesskey="t" value="<%=Server.HTMLEncode(Request("religion"))%>" size="20"></td>
            </tr>
            <tr>
              <td nowrap><b class="v11r">Mi<u>n</u>imum Age:</b></td>
              <td width="100%"><input accesskey="n" type="text" name="minprice" size="10" value="<%=Server.HTMLEncode(Request("minage"))%>"></td>
            </tr>
            <tr>
              <td nowrap><b class="v11r">Ma<u>x</u>imum Age:</b></td>
              <td width="100%"><input accesskey="x" type="text" name="maxprice" size="10" value="<%=Server.HTMLEncode(Request("maxage"))%>"></td>
            </tr>
            <tr>
              <td nowrap>&nbsp;</td>
              <td width="100%">&nbsp;
              </td>
            </tr>
            <tr>
              <td nowrap><b class="v11r"><u>R</u>ecords Per Page:</b></td>
              <td width="100%"><input accesskey="r" type="text" name="pagesize" size="10" value="<%=intPageSize%>"></td>
            </tr>
            <tr>
              <td colspan="2"><input name="btnRestart" type="button" class="v11r" onclick="javascript: window.location='<%=Request.ServerVariables("SCRIPT_NAME")%>'" value="Start Over">
&nbsp;&nbsp;
              <input name="btnSubmit" type="submit" class="v11r" value="Go!">
              </td>
            </tr>
        </table></td>
      </tr>
    </form>
    <tr>
      <td><hr class="v11r"></td>
    </tr>
    <%If objRs.EOF Then%>
    <!--No Records Found-->
    <tr>
      <td align="center"><span class="style1"><b><font size="4">No Members found!</font></b></span></td>
    </tr>
    <%Else%>
    <!--Records Found-->
    <tr>
      <td><table border="0" width="100%" cellpadding="3" cellspacing="3">
          <tr>
            <td colspan=3><b><span class="style1">Members Found:</span> <%=objRs.RecordCount%></b></td>
          </tr>
          <tr>
            <td align="center" colspan="3"><%=Paging(intPage, objRs.PageCount, objRs.RecordCount)%></td>
          </tr>
          <tr bgcolor="#efefef">
            <td width="4%" nowrap><b class="v11r"> ID</b></td>
            <td nowrap><strong class="v11r">Detail</strong></td>
            <td width="11%" align="right" nowrap><div align="left" class="v11r">Manglik</div>              </td>
          </tr>
          <%
				If objRs.PageCount < intPage Then intPage = objRs.PageCount
				objRs.AbsolutePage = intPage
				
				Dim strRowColor
				strRowColor = "#ffffff"
				
				Do While Not objRs.EOF And intRecord <= intPageSize
					%>
          <tr bgcolor="<%=strRowColor%>">
            <td nowrap class="v11r"><%=objRs("memberid").Value%></td>
            <td nowrap><p class="v11r"><%=objRs("name").Value%> ,<span class="v11g">  <%=objRs("dd").Value%>/<%=objRs("mm").Value%>/<%=objRs("yy").Value%></span>, <%=(objRs("age").Value)%> , <%=(objRs("height").Value)%> , <%=objRs("weight").Value%> Kg. , <%=objRs("mothertongue").Value%> , <%=objRs("religion").Value%>, <%=objRs("caste").Value%> , <%=objRs("gender").Value%> </p>
              <p class="v11r"><%=objRs("education").Value%> , <%=objRs("occupation").Value%>  , <%=objRs("maritalstatus").Value%> , <%=objRs("address").Value%> ,<span class="v11g"> <%=objRs("email").Value%> </span> </p>              <div align="left"></div>            
              <div align="left"></div>              <div align="left"></div></td>
            <td nowrap class="v11r"><%=objRs("manglik").Value%></td>
          </tr>
          <%
					If strRowColor = "#ffffff" Then strRowColor = "#90ee90" Else strRowColor = "#ffffff"
					intRecord = intRecord + 1
					objRs.MoveNext
				Loop
				%>
          <tr>
            <td colspan="3"><hr class="v11r"></td>
          </tr>
          <tr>
            <td align="center" colspan="3"><%=Paging(intPage, objRs.PageCount, objRs.RecordCount)%></td>
          </tr>
      </table></td>
    </tr>
    <%End If%>
  </table>
Code:
<%
'Object cleanup
If IsObject(objRs) Then
	If Not objRs Is Nothing Then
		If objRs.State = adStateOpen Then objRs.Close
		Set objRs = Nothing
	End If
End If

If IsObject(objCn) Then
	If Not objCn Is Nothing Then
		If objCn.State = adStateOpen Then objCn.Close
		Set objCn = Nothing
	End If
End If
%>