asp+access2003 数据库搜索问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 21:53:43
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=mdb.asp-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<%
dim nf
dim explace2
dim exclass
nf=request("nf")
exclass2=request("exclass2")
exclass=request("exclass")
set rs = server.CreateObject ("adodb.recordset")
if trim(nf)="" and trim(exclass2)="" and trim(exclass)="" then
sql="select * from zhxx order by z_nf asc"
end if
if trim(nf)="" and trim(exclass2)="" and trim(exclass)<>"" then
sql="select * from zhxx where z_hy like '%"&trim(ex

看代码没什么错误,你试一下在执行查询语句后输出一下sql语句,检查输出来的语句是不是你要执行的那条语句。
rs.open sql,bb,1,1
response.Write(sql)

写的也太罗嗦了吧...