📄 conn.asp
字号:
<%
public conn,UrlFile,AddIp
UrlFile=request.servervariables("SCRIPT_NAME")
AddIp=request.servervariables("remote_addr")
call conn_init()
'/////////连接到数据库服务器
sub conn_init()
set conn=server.createobject("ADODB.CONNECTION")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("/newmdbshop/program/Public/wxl_Shop.mdb")&";Persist Security Info=False"
end sub
'根据strSQL获取名称
function GetName(strSQL)
set tmpSql1=server.createobject("ADODB.recordset")
tmpSql1.open strSQL,conn,1,1
if not tmpSql1.eof then
GetName=tmpSql1(0)
else
GetName=""
end if
tmpSql1.close
set tmpSql1=nothing
end function
'//////检查用户是否合法登录
'用法:
'KeyId=session("YnAgri_KeyId")
'set UserInfo=CheckUser(KeyId)
'说明:如果这个检查通过以后,则产生一个UserInfo数据集
'UserInfo("int_sOleUserID") 用户编号
'UserInfo("str_sOleLoginName") 登录名
'UserInfo("str_sOleName") 姓名
'UserInfo("str_sOleDeptID") 所在部门
'UserInfo("int_sOleGroupID") 所属组
'UserInfo("dtm_sOleLogintTime") 登录时间
'UserInfo("str_sOleLoginIP") 登录IP
'/////////////////////////////
function CheckUser(KeyId)
if KeyId="" then KeyId=request("KeyId")
if KeyId="" then Back("未取到相关参数,操作超时,请登录!")
set tmpSql=server.createobject("ADODB.recordset")
tmpSql.open "select * from Web_SysOnline where str_sOleKeyId='"&KeyId&"'",conn,1,1
if tmpSql.eof then Back("操作超时,请登录!")
CheckUser=tmpSql
set tmpSql=nothing
conn.Execute("Update Web_SysOnline set dtm_sOleLastTime =#"&Now&"# where str_sOleKeyId='"&KeyId&"'")
end function
'////////返回一个提示信息,并返回上一页
sub Back(mesg)
%><script language='javascript'>alert('<%=mesg%>');setTimeout('history.go(-1)',1);</script><%
response.end
end sub
'///////显示数据列表的头
'参数说明:
'tmpMesg=左上角显示信息
'tmpRecordCount=总记录数
'tmpPageCount=总页数
'tmpPage=当前显示页
'tmpUrl=右上角链接
'tmpSplitPage=分页URL(注意,至少要传类似Url.asp?aa=)
'///////
sub HtmlListHead(tmpMesg,tmpRecordCount,tmpPageCount,tmpPage,tmpUrl,tmpSplitPage)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=tmpMesg%></title>
<LINK href="/program/js/newcss.css" type=text/css rel=stylesheet>
</head>
<body leftMargin="15" topMargin="0">
<div align="center">
<table border="0" cellspacing="0" cellpadding="3" align="center" width=100%>
<tr>
<td width="100%" height="5" align="right"></td>
</tr>
<tr>
<td width="100%" height="100%" valign="top">
<table border="0" width="99%" cellpadding="0" cellspacing="1" bgcolor="#0063C6">
<tr>
<td valign="top" align="center" bgcolor="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" background="/program/images/bg1.gif">
<tr>
<td style="font-size:11pt; color:#FFFFFF"> <b><%=tmpMesg%></b></td>
<td height="25" align="right"><a href="javascript:location.href='/program/welcome.asp';"><img border="0" src="/program/images/button03.jpg"></a>
</td>
<td width="2"></td>
</tr>
</table>
<table border="0" bgcolor="#ffffff" cellspacing="1" style="font-family: 宋体; font-size: 10pt; border: 1px ridge" width="100%">
<form name='goForm' method="post" action="<%=tmpSplitPage%>">
<tr bgcolor=#ffffff>
<td> <%=tmpRecordCount%>个记录/共<%=tmpPageCount%>页 第<font color=red><%=tmpPage%></font>页</td><td align="right"><a href='<%=tmpSplitPage&"&Page=1"%>'>首页</a> <a href='<%=tmpSplitPage&"&Page="&Page-1%>'>上一页</a> <a href='<%=tmpSplitPage&"&Page="&Page+1%>'>下一页</a> <a href='<%=tmpSplitPage&"&Page="&tmpPageCount%>'>未页</a> 第<input type=text name='Page' value='<%=Page%>' size=2>页<input type='submit' name='go' value='go'> <%=tmpUrl%>
</td>
</tr>
</form>
<table>
<table border="0" bgcolor="rgb(214,211,206)" cellspacing="1" style="font-family: 宋体; font-size: 10.5pt; border: 1px ridge" width=100%>
<tr>
<td valign="top"> </td>
<td align="center">
<div style="width:100%; height:455px;overflow: auto;">
<%
end sub
sub HtmlListEnd(tmpRecordCount,tmpPageCount,tmpPage,tmpUrl,tmpSplitPage)
%>
</div>
</td>
<td valign="top"> </td>
</tr>
</table>
<table border="0" bgcolor="rgb(214,211,206)" cellspacing="1" style="font-family: 宋体; font-size: 10pt; border: 1px ridge" width="100%">
<form name='goForm1' method="post" action="<%=tmpSplitPage%>">
<tr>
<td> <%=tmpRecordCount%>个记录/共<%=tmpPageCount%>页 第<font color=red><%=tmpPage%></font>页</td><td align="right"><a href='<%=tmpSplitPage&"&Page=1"%>'>首页</a> <a href='<%=tmpSplitPage&"&Page="&Page-1%>'>上一页</a> <a href='<%=tmpSplitPage&"&Page="&Page+1%>'>下一页</a> <a href='<%=tmpSplitPage&"&Page="&tmpPageCount%>'>未页</a> 第<input type=text name='Page' value='<%=Page%>' size=2>页<input type='submit' name='go' value='go'> <%=tmpUrl%>
</td>
</tr>
</form>
<table>
</td>
</tr>
</table>
</BODY></HTML>
<%
end sub
function CheckPurview(MenuId,OperatorId) 'MenuId--菜单编号,OperatorId--操作员编号
'CheckPurview="1|1|1|1"
'exit function
CheckPurview=0
if MenuId<>"" then
dim tmp1Purview,tmpPurviewG,tmpPurview,tmp2Purview
tmpPurviewG=0
'用户组的权限
Query="select int_sPvwState from web_SysPurview,web_SysOperators where Int_sPvwMenuID="&MenuId&" and int_sOperGrpID=web_SysPurview.int_sOperID and int_sPvwType=1 and web_SysOperators.int_sOperID="&OperatorId
'response.write Query
'response.end
set tmpG=conn.Execute(Query)
if not tmpG.eof then
tmpPurviewG=tmpG(0)
end if
'操作员的权限
Query="select int_sPvwState from web_SysPurview where Int_sPvwMenuID="&MenuId&" and int_sPvwType=0 and int_sOperID="&OperatorId
' response.write Query
'response.end
set tmpO=conn.Execute(Query)
if not tmpO.eof then
tmpPurviewO=tmpO(0)
end if
' response.write "|"&tmpPurviewG(0)&tmpPurviewG(1)&tmpPurviewG(2)&tmpPurviewG(3)&"|<br>"
' response.write "|"&tmpPurviewO(0)&tmpPurviewO(1)&tmpPurviewO(2)&tmpPurviewO(3)&"|<br>"
' response.end
if tmpPurviewO="0" or tmpPurviewO ="1" then
tmp1Purview=tmpPurviewO
else
tmp1Purview=tmpPurviewG
end if
'response.write "|"&tmp1Purview(0)&tmp1Purview(1)&tmp1Purview(2)&tmp1Purview(3)&"|<br>"
'response.end
if tmp1Purview="1" then
CheckPurview=1
else
CheckPurview=0
end if
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -