<%

	'Database Connection
	'DBConn : 설문 DataBase
	'RSConn : List Database	

	Dim DBFlag,RBFlag
	
	Sub DBConnect()
		
		Set DBConn=Server.CreateObject("ADODB.Connection")
		DBConn.Open "Driver=SQL Server; Server=" & SV_NAME & "; Database=" & DB_NAME & "; UID=" & UID & "; PWD=" & PWD
		DBFlag = True

	End Sub
	
	'DB 끊기
	Sub DBClose()

		If Not DBConn Is Nothing Then
			DBConn.Close
			Set DBConn = Nothing
		End If
		DBFlag = False
	End Sub

	Dim RSConn
	Dim TSV_NAME 
	Dim TDB_NAME
	Dim TUID,TPWD

	Dim XCONFIG_DOM
	Set XCONFIG_DOM = new XMLClass	
			
	'Tag 가져오기 (SurveyKey,catiKey)
	XCONFIG_DOM.LoadHDD("C:\panelKey.xml")

	TSV_NAME = XCONFIG_DOM.TAGTEXT("DBIP",0)
	TDB_NAME = XCONFIG_DOM.TAGTEXT("DBName",0)
	TUID = XCONFIG_DOM.TAGTEXT("DBID",0)
	TPWD = XCONFIG_DOM.TAGTEXT("DBPW",0)

	'SV_NAME = "211.239.157.71,63380"
	'DB_NAME = "survey"
	'UID = "asurvey"
	'PWD = "asurvey@1125"

	Set XCONFIG_DOM = Nothing

	Sub RsConnect()
		Set RSConn=Server.CreateObject("ADODB.Connection")
		RSConn.Open "Driver=SQL Server; Server=" & TSV_NAME & "; Database=" & TDB_NAME & "; UID=" & TUID & "; PWD=" & TPWD
		RBFlag = True
	End Sub
	
	'Panel DB 끊기
	Sub RsConClose()
		If Not RsConn Is Nothing Then
			RSConn.Close
			Set RSConn = Nothing
		End If
		RBFlag = False
	End Sub
%>
