DtoDatabases Collection
Properties
 
Methods
Add method
Remove method
Remarks
Use the Count property to find the number of members in the collection.
Example
’ instantiate session object and connect to a server
Dim my_session as New DtoSession
Dim result as DtoResult
result = my_session.Connect("myserver", "username", "password")
 
’ now use your session object to obtain db collection
Dim my_databases as DtoDatabases
Set my_databases = my_session.Databases
See Also
DtoDatabase Object
DtoSession Object
Methods Detail
Add method
Add an item to a DtoDatabases collection.
Syntax
result = Collection.Add(Object,[dsnName])
Arguments
Return Values
Remarks
This method takes a parameter of type object. Therefore, you are responsible for first instantiating the object and setting its properties before adding it to the collection.
This method will add the given database to the collection and to the underlying DBNAMES.CFG file on the server.
Example
Dim result As dtoResult
Dim database As DtoDatabase
 
Set database = New DtoDatabase
' Set properties for new database
database.Name = "MyDemodata"
database.DdfPath = "C:\test"
database.DataPath = "C:\test"
database.Flags = dtoDbFlagCreateDDF + dtoDbFlagRI
 
result = my_session.Databases.Add(database)
If NOT result = Dto_Success Then
MsgBox "Error"+ Session.Error(result)
End If
Remove method
Removes an item from a DtoDatabases collection.
Syntax
Collection.Remove(database,[deleteDDF])
Arguments
Return Values
Remarks
This method removes the item from the databases collection and from the underlying DBNAMES.CFG file.
Example
Dim result As dtoResult
result = my_session.Databases.Remove("MyDemodata",1)
If NOT result = Dto_Success Then
MsgBox "Error"+ my_session.Error(result)
End If