<html>
<head>
<!--link type="text/css" rel="stylesheet" href="stil.css" -->
<style>
	A:link {
		COLOR: blue; FONT-FAMILY: Tahoma, Arial, sans-serif; FONT-SIZE: 8pt; FONT-WEIGHT: normal; TEXT-DECORATION: none
	}
	A:visited {
		COLOR: #ffffff; FONT-FAMILY: Tahoma, Arial, sans-serif; FONT-SIZE: 8pt; FONT-WEIGHT: normal; TEXT-DECORATION: none
	}
	A:hover{
		COLOR: #CCFFFF; FONT-FAMILY: Tahoma, Arial, sans-serif; FONT-SIZE: 8pt; FONT-WEIGHT: normal; TEXT-DECORATION: none
	}
	A:active {
		COLOR: #ffffff; FONT-FAMILY: Tahoma, Arial, sans-serif; FONT-SIZE: 8pt; FONT-WEIGHT: normal; TEXT-DECORATION: none
	}

</style>
</head>
<body>
<%
	'---------------------------------
	function fselect(db,query)
		dim rs,con

		set con=server.createObject("adodb.connection")
		con.open db
		'con.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\inetpub\wwwroot\ecommerce\product.mdb"
		'con.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=c:\inetpub\wwwroot\ecommerce\product.mdb"
		set rs=server.createObject("adodb.recordset")

		rs.CursorLocation= 3 ' adUseClient

		rs.open query,con

		set fselect=rs

		set rs.activeconnection=nothing

		set fselect=rs
		con.close
		set con=nothing

    end function

	count=0
	set rs=fselect(Application("Product"),"select * from items where name like '%" & request("txtProduct") & "%'")
%>
<table align=center  width=100%>
<tr><td><font size=2><b>Found Products</b></td></tr>
<%
	while not rs.eof
		if rs.bof then break
		response.write "<tr><td><a href=""product1.asp?id=" & rs("id") &  """><font color=blue>" & rs("name") & "</font></a></td></tr>"
		count=count+1
		rs.moveNext
	wend
	rs.close
	set rs= nothing

	set rs=fselect(Application("Product"),"select * from cat where name like '%" & request("txtCategory") & "%'")
%>
<tr><td><hr></td></tr>
<tr><td><font size=2><b>Found Categories</b></td></tr>

<%
	while not rs.eof
		if rs.bof then break
		response.write "<tr><td><a href=""products.asp?id=" & rs("id") &  """><font color=blue>" & rs("name") & "</font></a></td></tr>"
		count=count+1
		rs.moveNext
	wend
	rs.close
	set rs= nothing
%>
</table>
<%

	if count>0 then
%>

<%  else %>
<br>
<p align=center>
<font ><b>No record found</b></font>
</p>
<%
	end if

%>
<hr>
<a href="search.html"><font color=black>Back to find</font></a>
</body>
</html>
