| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 560 人关注过本帖
标题:查询问题
取消只看楼主 加入收藏
marksman
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-7-1
收藏
 问题点数:0 回复次数:3 
查询问题
(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
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
快速回复:查询问题
数据加载中...
 
   



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

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