Please , i am tried to duplicate the filter of this code.But it not working. Probably the code is not correct. Can someone tell me where is wrong?Sorry I am totally beginner!!!thanks.
Code:
<%
dim Type1
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\pechita2\db\login.mdb")
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT DISTINCT Type FROM property ORDER BY Type"
sql="SELECT DISTINCT Type FROM property ORDER BY Area"
rs.Open sql,conn
Type1=request.form("Type")
Area=request.form("Area")
%>
<%
if Type1<>"" then
sql="SELECT propertyref,Area,Type,Price FROM property WHERE Type='" & Type1 & "'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn
if Area<>"" then
sql="SELECT propertyref,Area,Type,Price FROM property WHERE Area='" & Area & "'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn
%>
%>
propertyref |
Area |
Type |
Price |
<%
do until rs.EOF
response.write("")
response.write("" & rs.fields("propertyref") & " | ")
response.write("" & rs.fields("Area") & " | ")
response.write("" & rs.fields("Type") & " | ")
response.write("" & rs.fields("Price") & " | ")
response.write("
")
rs.MoveNext
loop
rs.close
conn.Close
set rs=Nothing
set conn=Nothing%>
<% end if %>