有关查询问题
这是我做的一个查询不知该如何做,错误好多,高手们,请帮帮我!!!!!!!!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include virtual="/inc/qlls_conn.asp"-->
<%
classic=trim(request("classic"))
city=trim(request("city"))
type1=trim(request("type"))
layer=trim(request("layer"))
size1=trim(request("size1"))
size2=trim(request("size2"))
money1=trim(request("money1"))
money2=trim(request("money2"))
local=trim(request("local"))
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
sql="select * from oldhouse where classic='"&classic&"' and city='"&city&"'"
if type1<>"不限" then
sql=sql&" or type='"&type1&"'"
end if
if layer<>"不限" then
sql=sql&" or layer='"&layer&"'"
end if
'if local<>"0" then
' sql=sql&" and local1 like'%"&local&"%'"
'end if
set rs=server.CreateObject("adodb.recordset")
'sql="select * from oldhouse where classic='"&classic&"' and city='"&city&"' or type='"&type1&"' or layer='"&layer&"' or local like'%"&local&"%'size>="&size1&" and size<="&size2&"'"or "money>="&money1&"money<="&money2
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write"对不起,没有相关记录!"
response.end
else
%>
<table width="774" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>id </td>
<td>层 </td>
<td>类型 </td>
<td>所在城市 </td>
<td>具体位置 </td>
</tr>
<% do while not rs.eof %>
<tr>
<td><%=rs("id")%> </td>
<td><%=rs("layer")%> </td>
<td><%=rs("type")%> </td>
<td><%=rs("city")%> </td>
<td><%=rs("local1")%> </td>
</tr>
<%
rs.movenext
if rs.eof then exit do
loop
%>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<%
end if
%>
</body>
</html>
<%rs.close%>
问题点数:20、回复次数:3Top
1 楼say1no2(Studying .NET)回复于 2003-12-03 10:04:30 得分 10
老兄,什么错误提示啊!Top
2 楼zapzap(zap)回复于 2003-12-03 10:18:50 得分 0
没有什么错误提示,就是读不取任何数据,总是没有相关记录...........Top
3 楼shleo(sky)回复于 2003-12-03 10:32:51 得分 10
把查询语句输出来
在查询分析器里一个条件一个条件分析Top




