If Conn.state = 0 Then
Reporter.ReportEvent micFail, "DB接続状況", "接続できません。"
Else
Reporter.ReportEvent micPass, "DB接続状況", "接続できます。"
End If
oCmd.ActiveConnection = Conn
oCmd.CommandType = 1
End Function
'SQLを実行して、結果を取得する
Public Function ExecuteSql(strSql)
oCmd.CommandText = strSql
Set Res = oCmd.Execute()
End Function
'データベース接続断開
Public Function DBClose()
If Conn.state = 1 Then
Conn.close
End If
Set Conn = Nothing
Set Res = Nothing
Set oCmd = Nothing
End Function
Public Function LoadEnvironment()
Dim configFile 'config file name
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
configFile = dir & "\global.xml"
If (fso.FileExists(configFile)) Then
Reporter.ReportEvent micPass, "「global.xml」存在状況", "存在する。"
Environment.LoadFromFile(configFile)
Else
Reporter.ReportEvent micFail, "「global.xml」存在状況", "存在しない。"
Call ExitCurrentTest
End If
End Function
Public Function ExitCurrentTest()
ExitTest
End Function
Public Function Val(valName)
Val = Environment.Value(valName)
End Function