PreviousDTO Programmer's Guide (9.1 revision 1) Next

DtoDSN Object

Show this topic in Library frames

An object representing a Pervasive.SQL DSN.

Properties

DbName
Gets or sets the Dbname associated with the DSN.
Description
Gets or sets the description of the DSN.
Name
Gets or sets the name of the DSN
OpenMode
Gets or sets the open mode enumeration of the DSN.
See DSN Open Mode for a list of possible values.
Session
Gets or sets the DtoSession object associated with this DtoDSN object.

Methods

None

Remarks

To obtain information about a particular database, use the DtoDatabase Object.

Example

To query the DbName associated with a DSN:

' instantiate session object 
Dim my_session as New DtoSession 
' connect to a server 
my_session.Connect("myserver", "username", "password") 
' now use your session object to obtain db collection 
my_dsns = my_session.DSNs 
first_dsn = my_dsns.Item(1) 
dsn_dbname = first_dsn.DbName 

To add a new DSN:

' 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 use your session object to obtain DSN collection 
Dim my_dsns as DtoDSNs 
Set my_dsns = my_session.DSNs 
' Populate new DtoDSN object 
Dim NewDSN as New DtoDSN 
NewDSN.DbName = "DEMODATA" 
NewDSN.Description = "A DSN for the DEMODATA db" 
NewDSN.Name = "Demodata_DSN" 
' now add the new DSN to the collection 
result = my_dsns.Add(NewDSN) 
See Also

DtoDSNs Collection
DtoSession Object


Chapter contents
Publication contents

Prev topic: DtoDSNs Collection
Next topic: DtoDictionary Object