asp表单查询access数据问题,为什么数据全部显示啊

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:58:51
<%
Dim pageSize,currPage,prevPage,nextPage,defautSize
defaultSize=4
pageSize=Request("pageSize")
currPage=Request("currpage")
If IsNull(pageSize) then
pageSize=defaultSize
End if
If IsEmpty(pageSize) Then
pageSize=defaultSize
End If
If Len(pageSize)<1 Then
pageSize=defaultSize
End If
If IsNull(currPage) then
currPage=1
End if
If IsEmpty(currPage) Then
currPage=1
End If
If Len(currPage)<1 Then
currPage=1
End If
if currPage<1 Then
currPage=1
End If
prevPage=currPage-1
nextPage=currPage+1

lx=request("lx")
dim conn,connstr,db,oRs,row
db1="data/db.mdb" '数据库文件的位置
row=0
Set conn = Server.CreateObject("ADODB.Connection"

这个问题的根本是你的SQL语句了,
if lx=null or lx="" then
sql="select * from [ALFZ] where [STATUS]=0 order by [id] desc"
else
sql="select * from [ALFZ] where [STATUS]=0 and ALLB='" &lx& "' order by [id] desc"
end if
这个是你的SQL语句
在这行的下面放上这句话 然后运行
response.write(sql)
response.end()
看看屏幕上输出的内容,就是你最终的SQL语句了。 仔细检查是不是你的条件给错了还是 条件没传到值。