'session.abandon
'Server.ScriptTimeOut=500
function opendb(DBPath,sessionname,dbsort)
dim conn
'if not isobject(session(sessionname)) then
Set conn=Server.CreateObject("ADODB.Connection")
'if dbsort="accessdsn" then conn.Open "DSN=" & DBPath
'if dbsort="access" then conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'if dbsort="sqlserver" then conn.Open "DSN=" & DBPath & ";uid=wsw;pwd=wsw"
DBPath1=server.mappath("../db/lmtof.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
set session(sessionname)=conn
'end if
set opendb=session(sessionname)
end function
%>
function strlength(inputstr)
dim length,i
length=0
for i=1 to len(inputstr)
if asc(mid(inputstr,i,1)) length=length+2
else
length=length+1
end if
next
strlength=length
end function
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then
response.write("")
response.write("window.top.location.href='default.asp';")
response.write("")
response.end
end if
errstr=getpopedom("allow_manage_docstoreroom",oabusyusername)
if errstr"" then
response.redirect "../asp/disperrorinfo.asp?errorinfo="&errstr
response.end
end if
%>
红孩儿Office办公系统
call bghead()
%>
档案资料类型管理
call bgmid()
%>
doctypename=replace(trim(request.form("newtypename")),"'","''")
id=request.form("id")
if request.form("submit")="增加" and doctypename"" then
if strlength(doctypename)>30 then
response.write("档案资料类型名称不能超过15个汉字!")
else
set conn=openconn("conn")
set rs=server.createobject("adodb.recordset")
sql="select * from TypeTable where TypeName='" & doctypename&"'"
rs.open sql,conn,1
if not rs.eof and not rs.bof then
%>
已经存在,请换名重试!
else
sql = "Insert Into TypeTable (TypeName) Values('" & doctypename &"')"
conn.Execute sql
%>
增加成功!
end if
end if
end if
'---------------------------------------------------
if request.form("submit")="删除" then
set conn=openconn("conn")
sql="delete from TypeTable where AutoID="&id
conn.execute(sql)
%>
删除成功!
end if
'---------------------------------------------------
if request.form("submit")="修改" and doctypename"" then
if strlength(doctypename)>30 then
response.write("档案资料类型名称不能超过15个汉字!")
else
set conn=openconn("conn")
set rs=server.createobject("adodb.recordset")
sql="select * from TypeTable where TypeName='" &doctypename&"' and AutoID"&id
rs.open sql,conn,1
if not rs.eof and not rs.bof then
%>
已经存在,请换名重试!
else
sql = "update TypeTable set TypeName='" & doctypename & "' where AutoID=" & id
conn.Execute sql
%>
修改成功!
end if
end if
end if
%>
set conn=openconn("conn")
set rs=server.createobject("adodb.recordset")
sql="select * from TypeTable"
rs.open sql,conn,1
while not rs.eof and not rs.bof
%>
rs.movenext
wend
set rs=nothing
conn.close
set conn=nothing
%>
call bgback()
%>