| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 548 人关注过本帖
标题:求助:请大家帮我看看asp登陆跳转问题
取消只看楼主 加入收藏
ailong2006
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-11-20
收藏
 问题点数:0 回复次数:0 
求助:请大家帮我看看asp登陆跳转问题
我的index.asp页通过浏览器直接打开就可以正常查询,但通过登陆界面跳转到index.asp,点查询就会出现对象无法打开的错,好头疼,代码如下,请高手救我~!!!用户名密码核对页checkadmin:
<%
dim admin_name,admin_pwd
admin_name=trim(request("admin_name"))
admin_pwd=trim(request("admin_pwd"))

Set rs = Session("objRS")
 rs.Source= "select * from admin where admin_name = '"&admin_name&"'"
 rs.open
if rs.eof then
       Response.Write "<script language='javascript'>window.confirm('用户名不正确!!');</script>"
       Response.Write "<script language='javascript'>parent.window.history.go(-1);</script>"
   else
    if rs("admin_pwd") <> admin_pwd then
       Response.Write "<script language='javascript'>window.confirm('密码不正确,请后退重填!!');</script>"
 Response.Write "<script language='javascript'>parent.window.history.go(-1);</script>"
    end if  
    session("admin_name")=admin_name
    response.redirect "index.asp"
 end if
   rs.Close   
     Set rs = Nothing
%>

index.asp页

<%@ LANGUAGE="VBScript" %>
<%
   if Session("admin")= " " then
   response.redirect "admin.asp"
   response.end
   end if
%>
<html>
<head>

<title>文档查询</title>
<script language="VBScript">
<!--
  Sub query_OnClick
     Dim msg
     msg = ""
   
     If search.gjz.value = "" Then
        msg = "关键字不能为空!请先输入..."
        search.gjz.focus
     End If

     If msg = "" Then
        search.submit
     Else
        Alert(msg)
     End If
  End Sub

  Sub reset_OnClick
     search.gjz.value = ""
     search.gjz.focus
  End Sub
 
  Sub out_Onclick
  window.location = "admin.asp"
  End Sub
 
-->
</script>

</head>
<body onload="reset_OnClick">
<center>
<h2> </h2>
<h2> </h2>
<h2><span style="font-weight: 400"><font face="华文行楷" size="6">文档查询系统</font></span></h2>
<form name="search" action="index.asp" method="post">
<table>
<tr><td colspan="6"> </td></tr>
<tr><td colspan="6"> </td></tr>
<tr>
  <td>文件关键字:&nbsp; </td>
  <td><input name="gjz" type="text" maxlength="8" size="25">&nbsp;</td>
     <td><input name="query" type="button" value="查询">&nbsp;</td>
  <td><input name="reset"  type="button" value="重设">&nbsp;</td>
</tr>
<tr><td colspan="6"> </td></tr>
<tr><td colspan="6" height="19"> </td></tr>
</table>
<p><input  name="out" type="button" value="退出查询" ></p>
<p> </p>
</form>
<%
  If Request("gjz") <> ""  Then  
     Set objRS = Session("objRS")
      objRS.Source = "SELECT * FROM file WHERE name & leibie LIKE '%" &Request("gjz")& "%' order by id desc"
      objRS.Open
     

     If objRS.RecordCount > 0 then
     
      Response.write ( objRS("leibie")&objRS("niandai")& objRS("num"))   
       objRS.MoveNext
       Loop
             Else
        Response.Write("没有找到!")
     End If
  ' 注释:断开数据库连接
     objRS.Close      ' 关闭记录集
     Set objRS = Nothing
  End If
%>

</center>
</body>
</html>



查询输入关键字错误如下
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

ADODB.Recordset 错误 '800a0e79'

对象打开时,操作不被允许。

/filesearch/index.asp,行68



行68 就是:objRS.Source = "SELECT * FROM file WHERE name & leibie LIKE '%" &Request("gjz")& "%' order by id desc"
搜索更多相关主题的帖子: 登陆 asp 
2008-11-20 14:25
快速回复:求助:请大家帮我看看asp登陆跳转问题
数据加载中...
 
   



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

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