<%
Dim Conn,strSQL,objRec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("mydatabase.mdb"),"" , ""
'*** Search By Name or Email ***'
strSQL = "SELECT * FROM customer WHERE 1=1"
IF Request.QueryString("date") <> "" Then
strSQL = strSQL & " AND (action BETWEEN '"& Request.QueryString("date") &"' and '"& Request.QueryString("date1") &"') "
End IF
IF Request.QueryString("txtCustomername") <> "" Then
strSQL = strSQL & " AND (Customername LIKE '%"& Request.QueryString("txtCustomername") &"%') "
End IF
IF Request.QueryString("txtcard") <> "" Then
strSQL = strSQL & " AND (cardID LIKE '%"& Request.QueryString("txtcard") &"%') "
End IF
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3