<!--#include file="tgzcm.Include/tgzcm.Security.asp" -->
<!--#include file="tgzcm.Cache/tgzcm.Config.asp"-->
<!--#include file="tgzcm.Include/tgzcm.Funciton.asp"-->
<!--#include file="tgzcm.Sql.asp" -->
<%
Dim Sql,rs,tgzcmPath,moban
Dim SystemDatabaseType
Dim db, SqlDatabaseName, SqlPassword, SqlUsername, SqlHostIP
tgzcmPath = request.servervariables("path_info")
tgzcmPath = left(tgzcmpath,instrrev(tgzcmpath, "/"))'获取安装目录
UserTrueIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")'获取用户来源IP
If UserTrueIP = "" Then UserTrueIP = Request.ServerVariables("REMOTE_ADDR")
UserTrueIP = ReplaceBadChar(UserTrueIP)

SystemDatabaseType=tgzcm(4)             '系统数据库类型，请修改tgzcm.Cache/tgzcm.Config.asp里的变量tgzcm(4)值
tgzcmdb =tgzcm(5)                        'ACCESS数据库的文件名，请修改tgzcm.Cache/tgzcm.Config.asp里的变量tgzcm(5)值
SqlHostIP = tgzcm(6)                    'SQL数据库IP
SqlDatabaseName = tgzcm(7)              'SQL数据库名							   
SqlUsername = tgzcm(8)                  'SQL数据库用户名
SqlPassword = tgzcm(9)                  'SQL数据库用户密码
               
'数据库链接字段请不需要修改------------------------------------------------------------------------------
If SystemDatabaseType = "SQL" Then
	tgzcmConn= "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlHostIP & ";"
Else
	tgzcmConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(tgzcmdb)
End If
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open tgzcmConn
If Err Then
	Err.Clear
	Set Conn = Nothing
	Response.Write "数据库连接出错，请检查Conn.asp文件中的数据库参数设置。"
	Response.End
End If

'数据库关闭--------------------------------------------------------------------------------------
Sub CloseConn()
    On Error Resume Next
    If IsObject(Conn) Then
        Conn.Close
        Set Conn = Nothing
    End If
End Sub
%>