Public
Function GetConnection(ByVal dbName)
if dbName = "" then dbName = "MALLDB"
Dim Cnn
Set Cnn = CreateObject("ADODB.Connection")
With Cnn
.Provider = "SQLNCLI10"
.Properties("Data Source").Value =
"TCP:XXX.XXX.XX.X1" 'DB 서버
.Properties("Initial Catalog").Value = dbName ' 데이터베이스명
.Properties("User ID").Value =
"USERID" '
.Properties("Password").Value =
"PASSWORD"
.Properties("Failover Partner").Value =
"TCP:XXX.XXX.XX.X2" 'Mirror
서버
.ConnectionTimeout = 60
.Open
End With
Set GetConnection = Cnn
Set Cnn = Nothing
End Function
댓글
댓글 쓰기