<!--#include file="conn.asp"-->
<%
'==================================博科网络科技温馨提示以下代码请勿改动==================================
Dim Conn,ConnStr
Dim BK_True, BK_False, BK_Now, BK_OrderType, BK_DatePart_Y, BK_DatePart_M, BK_DatePart_D, BK_DatePart_H,BK_DatePart_N, BK_DatePart_S,BK_DatePart_W
'Sub OpenConn() '定义打开数据库函数。在需要调用数据库的页面前加 Call OpenConn 调用执行以打开数据库，一般放在页面前面（数据库使用前）。
    If SystemDatabaseType = 1 Then
        ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlHostIP & ";"
    Else
	    Set Conn = Server.CreateObject("ADODB.Connection")        
		ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(""&SysRootDir&"Database/"&DBFileName&"")
		Conn.open ConnStr
    End If
    'On Error Resume Next
    If Err Then
        Err.Clear
        Set Conn = Nothing
        Response.Write "数据库连接出错，请检查Database.asp文件中的数据库参数设置。"
        Response.End
    End If

    If SystemDatabaseType = 1 Then
        BK_True = "1"
        BK_False = "0"
        BK_Now = "GetDate()"
        BK_OrderType = " desc"'倒序排序从大到小        
        BK_DatePart_Y = "yy"'年
        BK_DatePart_M = "mm"'月
		BK_DatePart_D = "dd"'日       
        BK_DatePart_H = "hh"'时
        BK_DatePart_N = "mi"'分
		BK_DatePart_S = "ss"'秒
        BK_DatePart_W = "wk"'一年第几周
    Else
        BK_True = "True"
        BK_False = "False"
        BK_Now = "Now()"
		BK_OrderType = " desc"'倒序排序从大到小             
        BK_DatePart_Y = "'yyyy'"'年
        BK_DatePart_M = "'m'"'月
		BK_DatePart_D = "'d'"'日       
        BK_DatePart_H = "'h'"'时
		BK_DatePart_N = "'n'"'分
		BK_DatePart_S = "'s'"'秒
		BK_DatePart_W = "'ww'"'一年第几周
    End If

'End Sub

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="Function.Asp" -->
