‎27-09-2016 02:58 PM
Hi Everybody,
I would like to create repositories using VBScript API.
‎29-09-2016 03:48 PM
We already use a HOPEX V2 release
‎28-09-2016 11:48 AM
It has been tested with HOPEX V1R3. It does not mean it cannot work with HOPEX V1R2
There may be another issue. It will be not be easy to investigate give the status of the version
HOPEX V1R2 is in limited support phase that will end in december 2016.
http://community.mega.com/t5/General-Information/Support-Policy/ta-p/6216
It is important that you consider upgrade to HOPEX V1R3 or HOPEX V2
‎28-09-2016 11:22 AM
Hello Jerome,
This script works with HOPEX V1R3 release but ours is a V2 release.
This script throws this error : Error(0x80020009) : Il n'existe pas de 'Référentiel MEGA' ayant pour 'Identifiant absolu' la valeur 'ofVYgfuwNDdH'
‎28-09-2016 09:23 AM
Here is a code example (VB script, tested with HOPEX V1R3 CP14)
sEnvPath = "C:\_StandardData\750_cp14_V1R3_Demonstration" sAdministrator = "Administrator" sAdminPwd = "" sRepositoryName = "MyDatabase2" sRepositoryPath = sEnvPath & "\Db\" & sRepositoryName 'open environnement in administration session Set oMegaApp = CreateObject("Mega.Application") MsgBox "Installation used: " & oMegaApp.Path Set oEnvironment = oMegaApp.Environments.Item(sEnvPath) MsgBox "Environment opened: " & oEnvironment.Name oEnvironment.CurrentAdministrator = sAdministrator oEnvironment.CurrentPassword = sAdminPwd Set oRepositories = oEnvironment.Databases 'create a repository Set oRepository = oRepositories.Create(sRepositoryName,sRepositoryPath) MsgBox "Repository created: " & oRepository.Name 'close environment Set oRepositories = Nothing MsgBox "End of processsing" Set oMegaApp = Nothing
‎27-09-2016 05:09 PM
Hello Jerome,
I use a GBMS storage
Thanks, Bruno
‎27-09-2016 03:49 PM
Hello bsalzema
Check the type of storage used because the expected code varies according to the storage.
With GBMS storage
Create (RepositoryName, RepositoryPath)
With SQL Server storage
Create (RepositoryName, RepositoryPath, ConnectionString)
Where ConnectionString
TYPE=SQLSERVER ;SERVER=<instance> ;IUD=<user> ;PWD=<password>
Example of ConnectionString
"TYPE=SQLSERVER ;SERVER=myserver\myinstance ;UID=mysuser ;PWD=mypassword"