<%
dim conn,db,PE_True,PE_False,PE_Now
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlHostIP
dim SiteName,SiteTitle,SiteKey,SiteUrl,InstallDir,LogoUrl,BannerUrl,WebmasterName,WebmasterEmail,Copyright
dim ShowSiteChannel,ShowAdminLogin,ShowRunTime,EnableSaveRemote,EnableLinkReg,SessionTimeout,objName_FSO
dim EnableUserReg,EmailCheckReg,AdminCheckReg,PerWealth
dim Mail
Object,MailServer,MailServerUserName,MailServerPassWord,MailDomain
const SystemVersion=1 '动易网站管理系统的版本,1为免费版,2为个人版,3为企业版
const SystemDatabaseType="ACCESS" '系统数据库类型,"SQL"为MS SQL2000数据库,"ACCESS"为MS ACCESS 2000数据库
'如果是ACCESS数据库,请认真修改好下面的数据库的文件名
db="\cwdu\database\PowerEasy4.mdb" 'ACCESS数据库的文件名,请使用相对于网站根目录的的绝对路径
'如果是安装在网站根目录,直接修改文件名即可。如果是安装在网站某一目录下,则在前面加上此目录,
'例如,系统安装在“http://www.asp163.net/PE4/”目录下(PE4为安装目录),则这里应该修改为:db="\PE4\database\PowerEasy4.mdb"
'如果是SQL数据库,请认真修改好以下数据库选项
SqlUsername = "PowerEasy" 'SQL数据库用户名
SqlPassword = "PowerEasy*9988" 'SQL数据库用户密码
SqlDatabaseName = "PowerEasy40" 'SQL数据库名
SqlHostIP = "127.0.0.1" 'SQL主机IP地址(本地可用“127.0.0.1”或“(local)”,非本机请用真实IP)
call OpenConn()
call GetSiteConfig()
sub OpenConn()
On Error Resume Next
dim ConnStr
if SystemDatabaseType="SQL" then
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlHostIP & ";"
else
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
end if
Set conn = Server.Create
Object("ADODB.Connection")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查Conn.asp文件中的数据库参数设置。"
Response.End
End If
Application("DbPath")=db
Application("ConnStr")=ConnStr
Application("SystemVersion")=SystemVersion
Application("SystemDatabaseType")=SystemDatabaseType
if SystemDatabaseType="SQL" then
PE_True="1"
PE_False="0"
PE_Now="getdate()"
else
PE_True="True"
PE_False="False"
PE_Now="Now()"
end if
end sub
sub CloseConn()
On Error Resume Next
If Is
Object(Conn) Then
conn.close
set conn=nothing
end if
end sub
sub GetSiteConfig()
dim sqlConfig,rsConfig
sqlConfig="select * from PE_Config"
set rsConfig=Server.Create
Object("ADODB.Recordset")
rsConfig.open sqlConfig,conn,1,3
if rsConfig.bof and rsConfig.eof then
response.write "网站配置数据丢失!系统无法正常运行!"
response.end
else
SiteName=rsConfig("SiteName")
SiteTitle=rsConfig("SiteTitle")
SiteUrl=rsConfig("SiteUrl")
SiteKey=rsConfig("SiteKey")
InstallDir=rsConfig("InstallDir")
LogoUrl=rsConfig("LogoUrl")
BannerUrl=rsConfig("BannerUrl")
WebmasterName=rsConfig("WebmasterName")
WebmasterEmail=rsConfig("WebmasterEmail")
Copyright=rsConfig("Copyright")
ShowSiteChannel=rsConfig("ShowSiteChannel")
ShowAdminLogin=rsConfig("ShowAdminLogin")
ShowRunTime=rsConfig("ShowRunTime")
EnableSaveRemote=rsConfig("EnableSaveRemote")
EnableLinkReg=rsConfig("EnableLinkReg")
SessionTimeout=rsConfig("SessionTimeout")
objName_FSO=rsConfig("objName_FSO")
EnableUserReg=rsConfig("EnableUserReg")
EmailCheckReg=rsConfig("EmailCheckReg")
AdminCheckReg=rsConfig("AdminCheckReg")
PerWealth=rsConfig("PerWealth")
Mail
Object=rsConfig("Mail
Object")
MailServer=rsConfig("MailServer")
MailServerUserName=rsConfig("MailServerUserName")
MailServerPassWord=rsConfig("MailServerPassWord")
MailDomain=rsConfig("MailDomain")
end if
rsConfig.close
set rsConfig=nothing
end sub
%>