Function executeQuery(sql)
Set executeQuery = Server.CreateObject("ADODB.Recordset")
executeQuery.ActiveConnection = MM_conn_STRING
executeQuery.Source = sql
executeQuery.CursorType = 0
executeQuery.CursorLocation = 2
executeQuery.LockType = 1
executeQuery.Open()
End Function
Function executeUpdate(sql)
Dim conn
set conn=server.createobject("ADODB.CONNECTION")
conn.open MM_conn_STRING
conn.Execute sql
End Function
Function executeDelete(sql)
Dim conn
set conn=server.createobject("ADODB.CONNECTION")
conn.open MM_conn_STRING
conn.Execute sql
End Function
function makefilename(fname)
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
makefilename=fname
end function
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
Function checkUser(userright)
If Session("userright")userright AND Session("userright")"admin" Then
showMsg("对不起,您还没有登录,或没有足够的权限,无法进行此操作。")
'Response.Redirect("error.asp")
End If
End Function
Function logout()
Session.Contents.Remove("userright")
Session.Contents.Remove("cardno")
Session.Contents.Remove("username")
Response.Redirect("login.asp")
End Function
Function showFoot()
%>
< 联系我们
- >
End Function
Function showMsg(msg)
If msg="" Then msg="对不起,您还没有登录,或没有足够的权限,无法进行此操作。"
%>
图书管理系统
» 提示信息
提示信息
Response.End()
End Function
Function freshTo(msg,url)
%>
图书管理系统
» 提示信息
提示信息
程序将带你到相关页面,如果你不想等待,请点击这里。
Response.End()
End Function
Function addLog(userright,username,action)
Dim conn,sql
set conn=Server.CreateObject("ADODB.CONNECTION")
conn.Open MM_conn_STRING
'use default
If userright="" Then userright = Session("userright")
If username="" Then
If userright = "admin" Then
username = Session("username")
Else
username = Session("username") & "(" & Session("cardno") & ")"
End If
End If
sql = "INSERT INTO log (userright,username,[action],[date],ip) VALUES ("
sql = sql & " '" & Replace(userright, "'", "''") & "'"
sql = sql & ",'" & Replace(username, "'", "''") & "'"
sql = sql & ",'" & Replace(action, "'", "''") & "'"
sql = sql & ",'" & now()&"'"
sql = sql & ",'" & Request.ServerVariables("REMOTE_ADDR") & "'"
sql = sql & ")"
conn.Execute sql
conn.Close
End Function
%>