'Connect to QC
'sURL: QC link
'sDomin: Domain
'sProject:Project
'sUser:UserName
'sPwd:Password
Function ConnectQC(sURL, sDomin, sProject, sUser, sPwd)
ConnectQC = 0
Set tdQC = CreateObject("TDApiOle80.TDConnection.1")
On Error Resume Next
tdQC.InitConnectionEx sURL
If ERR.Number <> 0 Then
ConnectQC = -1
Exit Function
End If
On Error GoTo 0
On Error Resume Next
tdQC.Login sUser, sPwd
If ERR.Number <> 0 Then
ConnectQC = -1
Exit Function
End If
On Error GoTo 0
On Error Resume Next
tdQC.Connect sDomin, sProject
If ERR.Number <> 0 Then
ConnectQC = -1
Exit Function
End If
On Error GoTo 0
End Function
'Disconnect QC
Function DisconnectQC()
tdQC.ReleaseConnection
End Function