M
Mikhail Mintchenkov
Hi all,
I'm trying to use CMI to perform some operations.
Below the VBS code to open and close DB.
But it outputs "No database open"
(CMIEXP otputs ok when I type DBOPEN MY_SERVER ).
Where the difference can be ?
Best Regards,
Mikhail
Dim server
server = "MY_SERVER" 'set the server name
Dim g_oCMI
Set g_oCMI = Wscript.CreateObject( "CMI.CMI") 'Create CMI
Dim nOpenMode
nOpenMode = cmiDBReadOnly
g_oCMI.OpenDB server , nOpenMode 'Open the DB with minimal requirements
If g_oCMI.DBOpenMode = cmiDBNotOpen Then ' If not open..
Wscript.Echo "No database open."
Else
Wscript.Echo "Server : " & g_oCMI.DBServerName
Wscript.Echo "Database : " & g_oCMI.DBName
Wscript.Echo "Generation : " & g_oCMI.DBGeneration
Wscript.Echo "Open mode : " & ValueToString(g_oCMI.DBOpenMode,
cmiDBOpenModeEnum, True)(1)
End If
g_oCMI.CloseDB
I'm trying to use CMI to perform some operations.
Below the VBS code to open and close DB.
But it outputs "No database open"
(CMIEXP otputs ok when I type DBOPEN MY_SERVER ).
Where the difference can be ?
Best Regards,
Mikhail
Dim server
server = "MY_SERVER" 'set the server name
Dim g_oCMI
Set g_oCMI = Wscript.CreateObject( "CMI.CMI") 'Create CMI
Dim nOpenMode
nOpenMode = cmiDBReadOnly
g_oCMI.OpenDB server , nOpenMode 'Open the DB with minimal requirements
If g_oCMI.DBOpenMode = cmiDBNotOpen Then ' If not open..
Wscript.Echo "No database open."
Else
Wscript.Echo "Server : " & g_oCMI.DBServerName
Wscript.Echo "Database : " & g_oCMI.DBName
Wscript.Echo "Generation : " & g_oCMI.DBGeneration
Wscript.Echo "Open mode : " & ValueToString(g_oCMI.DBOpenMode,
cmiDBOpenModeEnum, True)(1)
End If
g_oCMI.CloseDB