标题:查询问题
只看楼主
marksman
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-7-1
 问题点数:0 回复次数:5 
查询问题
(dim search_name,search_number,search_sql_values
search_name=cstr(request.form("name_search"))
search_number=cstr(request.form("number_search"))
if len(search_name)=0 and len(search_number)=0 then
  response.redirect("search_error.asp")
 else
  if len(search_name)=0 then
   search_sql_values="select * from user_inf where 流程序号='"&search_number&"'"
  else
   search_sql_values="select * from user_inf where 宝宝姓名='"&search_name&"'"
  end if
end if
大家帮个忙吧
俺不知道我的它为什么不能查询
查出来也只是一个空行
我现在晕的不行了,哪位高手帮一下,万分感谢
搜索更多相关主题的帖子: 查询 
2005-07-11 08:55
盖茨他爹
Rank: 6Rank: 6
等 级:贵宾
威 望:28
帖 子:5255
专家分:0
注 册:2005-5-3
得分:0 
没有让显示结果的代码怎么显示查询内容?
2005-07-11 08:57
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
高手

2005-07-11 09:02
marksman
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-7-1
得分:0 
干脆把代码全放上来吧
<% dim search_sql,search
search_sql="select * from user_inf Order By id DESC"
set search=Server.CREATEOBJECT("ADODB.recordset")
search.open search_sql,dbconnection
dim search_name,search_number,search_sql_values
search_name=cstr(request.form("name_search"))
search_number=cstr(request.form("number_search"))
if len(search_name)=0 and len(search_number)=0 then
  response.redirect("search_error.asp")
 else
  if len(search_name)=0 then
   search_sql_values="select * from user_inf where 流程序号='"&search_number&"'"
  else
   search_sql_values="select * from user_inf where 宝宝姓名='"&search_name&"'"
  end if
end if
response.write(search_sql_values)
dbconnection.execute(search_sql_values)
if search.bof and search.eof then
 response.redirect "find_error.asp"
else
 dim search_data
search_data=array("id","流程序号","宝宝姓名","性别","年龄","星座","前台接待","拍摄日期","摄影师","留底数","拍摄文件位置","补拍日期","补拍摄影师","补拍留底数","补拍文件位置","看样前过滤","不看样","看样日期","看样签字","选底数","套系规格","相册制作要求/相册类型","入册页数","全屏尺寸","取件日期","具体要求","备注","送件人","接件人","文件位置","设计排版","看样签收","看样回件签收","第二次出件看样","第二次看样回件签收","回件日期","修片调色","复核","输出打片","校片整理","制作出件人","其他","收件人","合格","店长确认","不合格原因","相册制作","出件日期","前台核对","客户取件日期","校对出件人")
 dim search_key,search_tmp,search_temp(50)
  search_key=1
 while search_key<=50
  search_tmp=search_data(search_key)
  search_temp(search_key)=search(search_tmp)
%>
<% =search_tmp %>
<% =search_temp(search_key)%>
<%
  search_key=search_key+1
 wend
end if
%>
帮帮忙吧,两位老大

2005-07-11 09:18
marksman
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-7-1
得分:0 
哪里出错了,请指条明路吧!

2005-07-11 09:33
marksman
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-7-1
得分:0 
搞定了,谢谢大家了

2005-07-11 11:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-22646-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040864 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved