asp后台问题
opendb.asp中的代码<%
session.abandon
'Server.ScriptTimeOut=500
function opendb(DBPath,sessionname,dbsort)
dim conn,StrCnn
if not isobject(session(sessionname)) then
Set conn=Server.CreateObject("ADODB.Connection")
DBPath1=server.MapPath("/oa/office/database/myoffice.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
'StrCnn = "Driver={SQL Server};Server=220.113.41.48;UID=vip8848;PWD=s8wfsqlde3acvip;Database=vip88481"
'StrCnn = "Driver={SQL Server};Server=192.168.8.198;UID=sa ;PWD=;Database=vip88481"
'conn.Open StrCnn
response.write DBPath1
response.end
set session(sessionname)=conn
end if
set opendb=session(sessionname)
end function
%>
index.asp中的代码
<!--#include file="office/asp/sqlstr.asp"-->
<!--#include file="office/asp/opendb.asp"-->
<%
'登录
username=request("username")
password=request("password")
if username<>"" and password<>"" then
'打开数据库查找是否有此用户
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from userinf where username=" & sqlstr(username) & " and password=" & sqlstr(password) & " and forbid='no'"
rs.open sql,conn,1
'如果有此用户就进入系统
if not rs.eof and not rs.bof then
response.cookies("oabusyname")=rs("name")
response.cookies("oabusyusername")=rs("username")
response.cookies("oabusyuserdept")=rs("userdept")
response.cookies("oabusyuserlevel")=rs("userlevel")
response.cookies("cook_allow_see_all_workrep")=rs("allow_see_all_workrep")
response.cookies("cook_allow_see_dept_workrep")=rs("allow_see_dept_workrep")
response.cookies("cook_allow_control_dept_user")=rs("allow_control_dept_user")
response.cookies("cook_allow_control_all_user")=rs("allow_control_all_user")
response.cookies("cook_allow_send_note")=rs("allow_send_note")
response.cookies("cook_allow_control_note")=rs("allow_control_note")
response.cookies("cook_allow_control_file")=rs("allow_control_file")
response.cookies("cook_allow_control_level")=rs("allow_control_level")
'response.cookies("cook_allow_see_all_personinf")=rs("allow_see_all_personinf")
'response.cookies("cook_allow_see_dept_personinf")=rs("allow_see_dept_personinf")
'response.cookies("cook_allow_edit_all_jobchanginf")=rs("allow_edit_all_jobchanginf")
'response.cookies("cook_allow_edit_dept_jobchanginf")=rs("allow_edit_dept_jobchanginf")
'response.cookies("cook_allow_edit_all_rewpuninf")=rs("allow_edit_all_rewpuninf")
'response.cookies("cook_allow_edit_dept_rewpuninf")=rs("allow_edit_dept_rewpuninf")
'response.cookies("cook_allow_edit_all_checkinf")=rs("allow_edit_all_checkinf")
'response.cookies("cook_allow_edit_dept_checkin")=rs("allow_edit_dept_checkinf")
response.redirect "office/gensystem.asp"
end if
end if
%>
<HTML><HEAD><TITLE>深圳市一之路科技有限公司网络办公平台</TITLE>
<META content="text/html; charset=GB2312" http-equiv=Content-Type><LINK
href="images/style.css" rel=STYLESHEET type=text/css>
<SCRIPT language=Javascript>
function ConfirmAction(message,url)
{if(confirm(message)) location = url ;}
</SCRIPT>
<META content="MSHTML 5.00.3103.1000" name=GENERATOR></HEAD>
<BODY aLink=#336699 background=images/logon.htm bgColor=#b9b9b9
link=#000000 text=black vLink=#333333>
<STYLE type=text/css>.fs {
COLOR: #ffffff; FONT-FAMILY: "宋体", "黑体", "楷体_GB2312", "隶书"; FONT-SIZE: 9pt
}
.inputline {
BACKGROUND-IMAGE: url(images/bg.gif); BORDER-BOTTOM: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 1px solid; COLOR: #5a5a5a; FONT-FAMILY: "宋体", "黑体", "楷体_GB2312", "隶书"; FONT-SIZE: 9pt
}
.btnbg {
BACKGROUND-IMAGE: url(images/login.gif); BACKGROUND-REPEAT: no-repeat; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-RIGHT: 0px; BORDER-TOP: 0px; CURSOR: hand; FONT-FAMILY: "宋体", "黑体", "楷体_GB2312", "隶书"; FONT-SIZE: 18px; MARGIN: 0px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
.btnreset {
BACKGROUND-IMAGE: url(images/reset.gif); BACKGROUND-REPEAT: no-repeat; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-RIGHT: 0px; BORDER-TOP: 0px; CURSOR: hand; FONT-FAMILY: "宋体", "黑体", "楷体_GB2312", "隶书"; FONT-SIZE: 18px
}
BODY {
MARGIN: 0px
}
</STYLE>
<TABLE background=images/main.jpg border=0 cellPadding=0 cellSpacing=0
height=420 width=780>
<TBODY>
<TR>
<TD>
<DIV id=login
style="HEIGHT: 113px; LEFT: 272px; POSITION: absolute; TOP: 349px; WIDTH: 208px; Z-INDEX: 2">
<TABLE border=0 cellPadding=0 cellSpacing=0 class=fs height=85
width="100%">
<FORM action=index.asp method=post name=Form1
onsubmit="CheckValue(this);return false">
<TR>
<TD width="37%">
<DIV align=right><FONT color=black>用户名:</FONT></DIV></TD>
<TD width="63%">
<INPUT class=inputline name=Block size=22>
</TD></TR>
<TR>
<TD width="37%">
<DIV align=right><FONT color=black>密 码:</FONT></DIV></TD>
<TD width=63>
<INPUT class=inputline name=Password size=22
type=password>
</TD></TR>
<TR>
<TD colSpan=2>
<DIV align=center>
<TABLE background="" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD> </TD>
<TD>
<DIV align=right><INPUT class=btnbg name=Submit type=submit value=" ">
</DIV></TD>
<TD>
<DIV align=left><INPUT class=btnreset name=reset type=reset value=" ">
</DIV></TD></TR></TBODY></TABLE></DIV></TD></TR><INPUT name=UserName
type=hidden> </FORM>
</TABLE></DIV></TD></TR></TBODY></TABLE>
<SCRIPT language=JavaScript>
if(document.forms[0] != null) {
if(document.forms[0].elements[0] != null) {
if(document.forms[0].elements[0].type != 'hidden')
document.forms[0].elements[0].focus();
}
}
</SCRIPT>
<!-- Copyright 2001, HotOA Inc. All Rights Reserved. -->
<SCRIPT language=JavaScript>
function CheckValue(thisform)
{
thisform.UserName.value = thisform.Block.value;
thisform.Block.value = "";
if (thisform.UserName.value.length == 0){
alert ('请输入用户名。');
}
else if (thisform.Password.value.length == 0){
alert ('请输入密码。');
}
else {
if (document.Form1.Password.value.length != 0 && document.Form1.UserName.value.length != 0)
thisform.submit();
}
}
</SCRIPT>
<SCRIPT language=JAVASCRIPT>
if(navigator.appName == "Netscape" &&
parseFloat(navigator.appVersion.substring(0,4)) >= 4 ) {
document.captureEvents(Event.KEYPRESS);
document.onkeypress = CheckKey;
function CheckKey(evt) {
if (evt.which == 13) {
CheckValue(document.Form1);
return false;
}
else {
return evt.which;
}
}
}
</SCRIPT>
</BODY></HTML>
当点index.asp中的登陆后会显示数据库的路径,没有转到想要转到的网页 我是个编程新手 请大家帮帮忙!!