求助:请大家帮我看看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>文件关键字: </td>
<td><input name="gjz" type="text" maxlength="8" size="25"> </td>
<td><input name="query" type="button" value="查询"> </td>
<td><input name="reset" type="button" value="重设"> </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"