Clemens,
Here is that code snippet that is written is VB script:
set oDTO = CreateObject("DTO.DtoSession.2") 'setting up objects
result = oDTO.Connect (wshnetwork.computername,wshnetwork.computername,"")
set oDSNs = CreateObject("DTO.DtoDSNs.2")
set myDSN = CreateObject("DTO.DtoDSN.2")
if not IsNull(oDB) then
myDSN.Name = "DEMODATA"
myDSN.Description = "DEMODATA DSN"
myDSN.Dbname = "DEMODATA" 'ADDING DSN
myDSN.Openmode = dtoNormalDSNOpenMode
result = myDSNColl.Add(myDSN)
logFileWrite.WriteLine "ADDING DSN: " + oDTO.Error(result) + " " + CStr(Date()) + " " + CStr(Time())
end if
Set myDB = oDTO.Databases 'set
result = myDB.Remove("DEMODATA",0) 'REMOVING DATABASE, don't delete dsn's
logFileWrite.Writeline "REMOVING DB: " + oDTO.Error(result) + " " + CStr(Date()) + " " + CStr(Time())
set oDB = CreateObject("DTO.DtoDatabase.2")
if not IsNull(oDB) then
oDB.Name = "DEMODATA" 'ADDING DATABASE
oDB.DdfPath = strInstallDir + "DEMODATA"
oDB.DataPath = strInstallDir + "DEMODATA"
oDB.Flags = 2
result = myDB.Add (oDB)
logFileWrite.Writeline "ADDING DB: " + oDTO.Error(result) + " " + CStr(Date()) + " " + CStr(Time())
end if
set oDSNs2 = CreateObject("DTO.DtoDSNs.2")
set myDSN2 = CreateObject("DTO.DtoDSN.2")
myDSN2.Name = "DefaultDB"
myDSN2.Description = "DefaultDB DSN"
myDSN2.Dbname = "DefaultDB" 'ADDING DSN
myDSN2.Openmode = dtoNormalDSNOpenMode
result = myDSNColl.Add(myDSN2)
logFileWrite.WriteLine "ADDING DSN: " + oDTO.Error(result) + " " + CStr(Date()) + " " + CStr(Time())
Set myDB2 = oDTO.Databases 'set
Del Hager
Pervasive Software