Eric_J_1985 2015-05-18 08:18 采纳率: 0%
浏览 1528

请帮我看看这段代码有什么问题,提示查询语句出错。

<%
set rs=server.CreateObject("ADODB.Recordset")
dim temp ,I
dim posid,posname, branch, manager, checktime,bz,mainpic,checkpic,checkquarter,group
temp=request.Form("input")
select case request.Form("search")
if session("group")="兴化" then
case 0 sql="select * from check where group='兴化' and posid like '%"&temp&"%' order by checktime asc"
case 1 sql="select * from check where group='兴化' and posname like '%"&temp&"%' order by checktime asc"
end if
if session("group")="泰州" then
case 0 sql="select * from check where posid like '%"&temp&"%' order by checktime asc"

case 1 sql="select * from check where posname like '%"&temp&"%' order by checktime asc"
end if

end select
Rs.open sql, conn,1,1

if temp="" then

response.write "&quot; &amp; chr(13) &amp; &quot;alert(&#39;请输入检索条件!&#39;);&quot; &amp; &quot;history.back()&quot; &amp; &quot;"
end if
if rs.EOF then
response.write "

没有找到相关信息!

"
response.end
end if
%>

  • 写回答

3条回答 默认 最新

  • danielinbiti 2015-05-18 08:22
    关注
    from后面没有写表名
    
     if session("group")="兴化" then
    case 0 sql="select * from 这里没有写表名 where group='兴化' and posid like '%"&temp&"%' order by checktime asc" 
    case 1 sql="select * from 这里没有写表名 where group='兴化' and posname like '%"&temp&"%' order by checktime asc"
    end if 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog