
ASP+MSSQL问题
ifrequest("sou")<>""thenorder=request.QueryString("sou")之后是连接数据库的内容SetProblem=Server....
if request("sou")<>"" then
order=request.QueryString("sou")
之后是连接数据库的内容
Set Problem = Server.CreateObject("ADODB.Recordset")
Problem.ActiveConnection = strCon
if trim(request.QueryString ("Classes"))<>"" then
Problem.Source = "Select * from [Problem] where Type="&Classes
else
Problem.Source = "Select * from [Problem] order by id desc"
end if
Problem.CursorType = 3
Problem.CursorLocation = 3
Problem.LockType = 3
Problem.Open()
if Problem.EOF then
TotalInfo=0
else
TotalInfo=Int((Problem("ID")-1000)/100)+1
end if
Problem.close
set Problem=nothing
其中
Problem.Source = "Select * from [Problem] where Type="&Classes
else
Problem.Source = "Select * from [Problem] order by id desc"
end if
这部分 我想让他只筛选Name字段中包含sou这个变量内容的记录
请问要怎么做 展开
order=request.QueryString("sou")
之后是连接数据库的内容
Set Problem = Server.CreateObject("ADODB.Recordset")
Problem.ActiveConnection = strCon
if trim(request.QueryString ("Classes"))<>"" then
Problem.Source = "Select * from [Problem] where Type="&Classes
else
Problem.Source = "Select * from [Problem] order by id desc"
end if
Problem.CursorType = 3
Problem.CursorLocation = 3
Problem.LockType = 3
Problem.Open()
if Problem.EOF then
TotalInfo=0
else
TotalInfo=Int((Problem("ID")-1000)/100)+1
end if
Problem.close
set Problem=nothing
其中
Problem.Source = "Select * from [Problem] where Type="&Classes
else
Problem.Source = "Select * from [Problem] order by id desc"
end if
这部分 我想让他只筛选Name字段中包含sou这个变量内容的记录
请问要怎么做 展开
展开全部
dim aa
aa=request.QueryString("sou")
Problem.Source="select * from [Problem] where Name like %" & aa & "%"
aa=request.QueryString("sou")
Problem.Source="select * from [Problem] where Name like %" & aa & "%"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询