。
<%
'*****************************************************************************
'数据库相关函数、过程
'*****************************************************************************
'连接数据库
dim oConn
sub DB_Connect(sDBConnect)
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sDBConnect
end sub
'断开与数据库的连接
sub DB_DisConnect()
oConn.Close
Set oConn = Nothing
end sub
'断开RS与数据库的连接
sub DB_RSConnect(RSobj)
RSobj.Close
Set RSobj = Nothing
end sub
'替换非法字符
function sqlEncode(str)
sqlEncode = Replace(str, "'","''")
end function
'接收表单数据
function getFormElem(str)
getFormElem = trim(sqlEncode(Request.Form(str)))
end function
function getElem(str)
getElem = trim(sqlEncode(Request.QueryString(str)))
end function
function getForm(str)
getForm = trim(sqlEncode(Request(str)))
End function
'获得8位随机数
function getRnd()
Randomize
getRnd = Int(90000000 * Rnd + 10000000)
end function
'加入日期的前导零
function fdate(str)
if len(str) = 1 then str = "0" & str
fdate = str
end function
'替换回车
function freturn(str)
if not isnull(str) then
freturn=replace(str,chr(13)&chr(10),"<br>")
end if
end function
'添加文章开头的空格
function fcontent(str)
dim i,temp
for i=1 to len(str)
if mid(str,i,1)=" " then
temp=" " & temp
else
exit for
end if
next
fcontent=temp & str
end function
'--get storetype name----
function getstname(typeid,byref oConn)
dim sqlt,rst
sqlt="select st_name from t_goodsType where st_typeid='" & typeid & "'"
set rst=oConn.execute(sqlt)
if not rst.eof then
getstname=rst(0)
else
getstname=""
end if
rst.close
set rst=nothing
end function
'--get user name----
function getusername(uid,byref oConn)
dim sqlt,rst
sqlt="select usr_name from t_userinfo where usr_id=" & uid
set rst=oConn.execute(sqlt)
if not rst.eof then
getusername=rst(0)
else
getusername=""
end if
rst.close
set rst=nothing
end function
'--get user name----
function getAdminUsername(uid,byref oConn)
dim sqlt,rst
sqlt="select Asr_name from t_AdminUserInfo where Asr_Id=" & uid
set rst=oConn.execute(sqlt)
if not rst.eof then
getAdminUsername=rst(0)
else
getAdminUsername=""
end if
rst.close
set rst=nothing
end function
'--get user email----
function getuseremail(uid,byref oConn)
dim sqlt,rst
sqlt="select usr_email from t_userinfo where usr_id=" & uid
set rst=oConn.execute(sqlt)
if not rst.eof then
getuseremail=rst(0)
else
getuseremail=""
end if
rst.close
set rst=nothing
end function
'--get admin email----
function getadminemail(sLevel,byref oConn)
dim sqlt,rst,stemp
stemp=""
sqlt="select usr_email from order_level_view where user_levelname like '%" & sLevel & "%' or op_name='" & sLevel & "'"
set rst=oConn.execute(sqlt)
if not rst.eof then
do while not rst.eof
stemp=stemp&";"& rst(0)
rst.movenext
loop
getadminemail=mid(stemp,2)
else
getadminemail=""
end if
rst.close
set rst=nothing
end function
'--judage if internal user of nokia----
function isInternalUsr(uid,byref oConn)
dim sqlt,rst
sqlt="select usr_isinternal from userinfo where usr_id=" & uid
set rst=oConn.execute(sqlt)
if not rst.eof then
isInternalUsr=rst(0)
else
isInternalUsr="N"
end if
rst.close
set rst=nothing
end function
'发信
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
' Input: fromwho ---- 发件人
' towho ---- 收件人
' ccwho ---- 抄送人
' subject ---- 邮件主题
' mailbody ---- 邮件内容
' mailformat ---- 邮件格式 0-HTML,1-TEXT
' bodyformat ---- 内容格式 0-HTML,1-TEXT
'
'-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
sub sendmail(fromwho,towho,ccwho,subject,mailbody,mailformat,bodyformat)
dim mymail
set mymail=server.createobject("CDONTS.NewMail")
mymail.mailformat=mailformat
mymail.bodyformat=bodyformat
mymail.from=fromwho
mymail.to=towho
mymail.cc=ccwho
mymail.subject=subject
mymail.body=mailbody
mymail.send
set mymail=nothing
end sub
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' input: usrName 用户名
' oConn 数据库连接对象
' output: GetUserTel 用户电话
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Function GetUserTel(usrName)
Dim varTempSql,TempRS,varUserTel
varTempSql="Select Usr_tel from userinfo where Usr_name='"&usrName&"'"
Set TempRS=oConn.Execute(varTempSql)
If Not TempRS.eof And Not TempRS.Bof Then
varUserTel=TempRS(0)
Else
varUserTel=""
End If
TempRS.Close
Set TempRS=nothing
GetUserTel=varUserTel
End Function
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' 验证管理员登录和权限
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Sub AdminCheck()
If session("admID")="" or isnull(session("admID")) then
Response.redirect("admin")
End If
End Sub
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
' 删除文件
'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Sub DeleteFileFun(varFilePath)
Dim varFSO
Set varFSO = CreateObject("Scripting.FileSystemObject")
If (varFSO.FolderExists(varFilePath)) then
varFSO.DeleteFile(varFilePath)
End If
varFSO.Close
Set varFSO=nothing
End Sub
%>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 无法打开工作组信息文件中的表 'MSysAccounts' 。
/music/_lib/_lib.asp, 第 10 行