??% Response.CodePage=65001 Response.Charset="utf-8" Dim SqlNowString,DataPart_D,DataPart_Y,DataPart_H Dim Conn,DBPath,CollectDBPath,DataServer,DataUser,DataBaseName,DataBasePsw,ConnStr,CollcetConnStr Const DataBaseType=0 '系统数据库类型,"1"为MS SQL2000数据库,"0"为MS ACCESS 2000数据?? Const MsxmlVersion=".3.0" '系统采用XML版本设置 Const EnableSiteManageCode = True '是否启用后台管理认证??是: True 否: False Const SiteManageCode = "0808" '后台管理认证码,请修改,这样即使有人知道了您的后台用户名和密码也不能登录后台 If DataBaseType=0 then '如果是ACCESS数据库,请认真修改好下面的数据库的文件名 DBPath = "/KS_Data/KesionCMS6.mdb" 'ACCESS数据库的文件名,请使用相对于网站根目录的的绝对路?? Else '如果是SQL数据库,请认真修改好以下数据库选项 DataServer = "(local)" '数据库服务器IP DataUser = "sa" '访问数据库用户名 DataBaseName = "KesionCMS6" '数据库名?? DataBasePsw = "989066" '访问数据库密?? End if '采集数据库路?? CollectDBPath="\KS_Data\Collect\KS_Collect.Mdb" '=============================================================== 以下代码请不要自行修??======================================= Call OpenConn Sub OpenConn() On Error Resume Next If DataBaseType = 1 Then ConnStr="Provider = Sqloledb; User ID = " & datauser & "; Password = " & databasepsw & "; Initial Catalog = " & databasename & "; Data Source = " & dataserver & ";" SqlNowString = "getdate()" DataPart_D = "d" DataPart_Y = "y" DataPart_H = "hour" Else ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DBPath) SqlNowString = "Now()" DataPart_D = "'d'" DataPart_Y = "'yyyy'" DataPart_H = "'h'" End If Set conn = Server.CreateObject("ADODB.Connection") conn.open ConnStr If Err Then Err.Clear:Set conn = Nothing:Response.Write "数据库连接出错,请检查Conn.asp文件中的数据库参数设置??:Response.End CollcetConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(CollectDBPath) End Sub Sub CloseConn() On Error Resume Next Conn.close:Set Conn=nothing End sub '==============================================全局临时变量类开??============================= Dim GCls:Set GCls=New GlobalVarCls Class GlobalVarCls Public StaticPreList,StaticPreContent,StaticExtension Private Sub Class_Initialize() StaticPreList = "list" rem 伪静态列表前缀 不能包含"?"??-" staticPreContent = "thread" rem 伪静态内容前缀 StaticExtension = ".html" rem 伪静态扩展名 End Sub Private Sub Class_Terminate() Set GCls=Nothing End Sub Public Function Execute(Command) If Not IsObject(Conn) Then OpenConn() On Error Resume Next Set Execute = Conn.Execute(Command) If Err Then Response.Write("查询语句为:" & Command & "
") Response.Write("错误信息为:" & Err.Description & "
") Err.Clear Set Execute = Nothing Response.End() End If 'Sql_Use = Sql_Use + 1 End Function Function GetUrl() On Error Resume Next Dim strTemp If LCase(Request.ServerVariables("HTTPS")) = "off" Then strTemp = "http://" Else strTemp = "https://" End If strTemp = strTemp & Request.ServerVariables("SERVER_NAME") If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT") end if strTemp = strTemp & Request.ServerVariables("URL") If Trim(Request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString) end if GetUrl = strTemp End Function '====================标志来访地址================ Public Property Let ComeUrl(ByVal strVar) Session("M_ComeUrl") = strVar End Property Public Property Get ComeUrl ComeUrl= Session("M_ComeUrl") End Property '================================================ End Class '==============================================全局临时变量类结??============================= %>