<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方客服中心 http://www.ip126.com
'微信公众号 ip126com
'QQ:530051328 mail:bbfhq@163.com
'=====================================
%>

<%
Dim Conn,ConnStr
Dim DN_True, DN_False, DN_Now, DN_OrderType, DN_DatePart_D, DN_DatePart_Y, DN_DatePart_M, DN_DatePart_W, DN_DatePart_H
    
    If SystemDatabaseType = 1 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(""&SysRootDir&""&SiteDataPath&"")    
    End If

   On Error Resume Next
	Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.open ConnStr
    If Err Then
        Err.Clear
        Set Conn = Nothing
        Response.Write "&#x6570;&#x636E;&#x5E93;&#x8FDE;&#x63A5;&#x9519;&#x8BEF;&#xFF0C;&#x8BF7;&#x68C0;&#x67E5;&#x8FDE;&#x63A5;&#x53C2;&#x6570;&#xFF01;&#x5728;/Include/conn.asp&#x6587;&#x4EF6;!<br>"
		Response.Write "Database Connection Error，please Check Your Connection Parameters！"
        Response.End
    End If
    If SystemDatabaseType = 1 Then
        DN_True = "1"
        DN_False = "0"
        DN_Now = "GetDate()"
        DN_DatePart_D = "d"
        DN_DatePart_Y = "yyyy"
        DN_DatePart_M = "m"
        DN_DatePart_W = "ww"
        DN_DatePart_H = "hh"
    Else
        DN_True = "True"
        DN_False = "False"
        DN_Now = "Now()"
        DN_DatePart_D = "'d'"
        DN_DatePart_Y = "'yyyy'"
        DN_DatePart_M = "'m'"
        DN_DatePart_W = "'ww'"
        DN_DatePart_H = "'h'"
    End If

sub closers(crs)'定义关闭对象函数，等同 Rs.Close:Set Rs=Nothing。在操作结束时及时用 Call CloseRs(rs)
if Not crs Is Nothing Then '如果对象未清除 
if (crs.state and 1)=1 then
crs.close'释放对象
end if
set crs=nothing'清空内存
end if
end sub
sub CloseDB(Econn)'定义关闭数据库函数。等同conn.close:conn=nothing。在操作结束时及时用 Call CloseDB(conn) ，一般放在页面最后，节约资源。
if Not Econn is Nothing then'内存中存在
if (Econn.state and 1)=1 then
Econn.close'关闭连接
end if
set Econn=nothing'清空内存
end if
end Sub%>
<!--#include file="Md5.asp"-->
<!--#include file="Function.asp" -->