|
|
Count
|
Returns the number of members in a collection.
|
|
Item
|
Returns a specific member of a DtoDatabases collection.
|
Use the Count property to find the number of members in the collection.
' 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
DtoDatabase Object
DtoSession Object
Add an item to a DtoDatabases collection.
|
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
|
|
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.
|
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.
Dim result As dtoResult Dim database As DtoDatabase Set database = New DtoDatabase ' Set properties for new database database.Name = "MYDATABASE" 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
Removes an item from a DtoDatabases collection.
|
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.
|
This method removes the item from the databases collection and from the underlying DBNAMES.CFG file.
Dim result As dtoResult result = my_session.Databases.Remove("MYDATABASE",1) If NOT result = Dto_Success Then MsgBox "Error"+ my_session.Error(result) End If
|
Chapter contents
Prev topic: Creating and Maintaining Catalogs and Dictionaries with DTO
|