Add an item to a DtoDSNs collection and creates a DSN on the server.
Syntax
result = Collection.Add(Object)
Arguments
Collection
DtoDSNs collection to which to add object.
Object
A new DtoDSN object
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.
Example
Dim result As dtoResult
Dim DSNs As DtoDSNs
Dim dsn As DtoDSN
Set dsn = New DtoDSN
' Set properties for new dsn
dsn.Name = "MyDemodata_DSN"
dsn.Description = "a sample DSN"
dsn.Dbname = "MyDemodata"
dsn.Openmode = dtoNormalDSNOpenMode
result = my_session.DSNs.Add(dsn)
If NOT result = Dto_Success Then
MsgBox "Error"+ my_session.Error(result)
End If
Remove method
Removes a DSN item from a DtoDSNs collection and deletes it from the server.
Syntax
result = Collection.Remove(dsn)
Arguments
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
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 does not remove the associated database or database name.