asp实现不了模糊查询,一点查询,全部出来了
asp实现不了模糊查询,一点查询,全部出来了,以下是结果页代码<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile...
asp实现不了模糊查询,一点查询,全部出来了,以下是结果页代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/asdg.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("giz") <> "") Then
Recordset1__MMColParam = Request.QueryString("giz")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_asdg_STRING
Recordset1.Source = "SELECT * FROM zhcx WHERE 展会名称(中文) LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' ORDER BY 时间 DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<% 展开
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/asdg.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("giz") <> "") Then
Recordset1__MMColParam = Request.QueryString("giz")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_asdg_STRING
Recordset1.Source = "SELECT * FROM zhcx WHERE 展会名称(中文) LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' ORDER BY 时间 DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<% 展开
展开全部
你先看看你的数据库是不是ACCESS
如果是的话
把匹配符%改成*
我今天下午也是搞了一个下午才知道
ACCESS跟SQL模糊查询这里的区别
唉
如果是的话
把匹配符%改成*
我今天下午也是搞了一个下午才知道
ACCESS跟SQL模糊查询这里的区别
唉
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
能查询出数据就说明程序没有问题,不能实现模糊查询就是sql语句有问题。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询