PreviousDTO Programmer's Guide (9.1 revision 1) Next

DtoTables Collection

Show this topic in Library frames

Returns a collection of DtoTable objects.

Properties

Count
Returns the number of members in a collection.
Item
Returns a specific member of a collection. You can pass an ordinal value or a table name.

Methods
None 
Remarks

This collection only includes the user defined tables and does not include system tables. The dictionary has to be successfully opened. In order to add or drop tables from the collection use AddTable and DropTable.

Use the Count property to find the number of members in the DtoTables collection.

Example
Using DtoDatabase

Before obtaining the Tables collection, you must first invoke the Open method on the database object, even if the database is not secured.

Dim m_session as new DtoSession 
Dim m_database as new DtoDatabase 
Dim table as new DtoTable 
Dim result as DtoResult 
result = m_session.Connect("server","user","password") 
m_database.Name = "demodata" 
m_database.Session = m_session 
' Open database, assuming database not secured 
result = m_database.Open("","") 
For each table in m_database.Tables 
if table.Name = "Billing" then 
` found the billing table 
End If       
next  
m_database.Close ` close the db if you open it 
Using DtoDictionary
Dim dictionary as new DtoDictionary 
Dim table as new DtoTable 
Dim result as DtoResult 
Dim location as string 
'find location of Billing table 
result = dictionary.Open("c:\pvsw\demodata") 
For Each table In dictionary.Tables 
   If table.Name = "Billing" Then 
      location = table.Location 
      exit For 
   End If       
next  
See Also

DtoDatabase Object
DtoDictionary Object
AddTable method
DropTable method
DtoTable Object


Chapter contents
Publication contents

Prev topic: DtoDictionary Object
Next topic: DtoTable Object