|
A collection of DtoDSN objects.
|
Count
|
Returns the number of members in a collection.
|
|
Item
|
Returns a specific member of a DtoDSNs collection.
|
Use the Count property to find the number of members in the collection.
' instantiate session object Dim my_session as New DtoSession Dim result as DtoResult ' connect to a server result = my_session.Connect("myserver", "username", "password") ' now get DSNs collection Dim my_dsns as DtoDSNs Set my_dsns = my_session.DSNs
DtoDSN Object
DtoSession Object
Add an item to a DtoDSNs collection and creates a DSN on the server.
|
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.
Dim result As dtoResult Dim DSNs As DtoDSNs Dim dsn As DtoDSN Set dsn = New DtoDSN ' Set properties for new dsn dsn.Name = "MYDATABASE_DSN" dsn.Description = "a sample DSN" dsn.Dbname = "MYDATABASE" dsn.Openmode = dtoNormalDSNOpenMode result = my_session.DSNs.Add(dsn) If NOT result = Dto_Success Then MsgBox "Error"+ my_session.Error(result) End If
Removes a DSN item from a DtoDSNs collection and deletes it from the server.
|
Collection
|
Collection from which to remove object.
|
|
dsn
|
A variant containing either the index (starting with 1) or the name of the item you wish to remove from the 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 does not remove the associated database or database name.
Dim result As dtoResult Dim DSNs As DtoDSNs result = my_session.DSNs.Remove("MYDSN") If NOT result = Dto_Success Then MsgBox "Error"+ my_session.Error(result) End If
|
Chapter contents
Prev topic: DtoDatabase Object
|