DtoDatabases Collection
Properties
Count | Returns the number of members in a collection. |
Item | Returns a specific member of a DtoDatabases collection. |
Methods
Remarks
Use the Count property to find the number of members in the collection.
Example
Dim my_session as New DtoSession
Dim result as DtoResult
result = my_session.Connect("myserver", "username", "password")
Dim my_databases as DtoDatabases
Set my_databases = my_session.Databases
See Also
Methods Detail
Add method
Add an item to a DtoDatabases collection.
Syntax
result = Collection.Add(Object,[dsnName])
Arguments
Collection | DtoDatabases collection to which to add object. |
Object | A new DtoDatabase object |
dsnName | optional - will create a standard server DSN for the new database |
Return Values
result | DtoResult long value indicating the result of the method call. Use the Error property of the
DtoSession Object to obtain a description for the result. |
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
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
Collection | Collection from which to remove object. |
database | A variant that can contain the index (starting with 1) or the database name of the item you wish to remove from the collection |
deleteDDF | Set to True to delete dictionary files. Set to False to leave dictionary files intact. |
Return Values
result | DtoResult long value indicating the result of the method call. Use the Error property of the
DtoSession Object to obtain a description for the result. |
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