Link to home
Start Free TrialLog in
Avatar of victorlong
victorlong

asked on

Data tree structure

I found it is difficult to remember the names of iterms in database. Can you list the full tree structure here something like:

Data1.Recordset.Fields(i).Name
-------------------------.Type
---------------.Fields.Count
-----.Database.Tabledefs(i).Name
--------------.Tabledefs.Count
Avatar of ESI
ESI

You'll find an example doing exactly what u need in the DAO Reference, either under Fields or Tabledefs,....
ESI is "Write" on.  VB contains an example in the help system showing you how to iterate through the tables and pull up all column properties.  If you give me an email address, I'll ship you some code that:

1) shows three linked listboxes, #1 all tables, # 2 columns and properties for  selected table, and #3, sample data for selected record.  All using DAO.  It calculates all space useage and average space per column for database as well as total columns in db.  I wrote it as a handy little tool, because you don't need an MSAccess sledge hammer to do a tack hammer's job!
ASKER CERTIFIED SOLUTION
Avatar of ChrisLewis
ChrisLewis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of victorlong

ASKER

Hi ChrisLewis...,

I am confused...what is your code for? Does that print out what I heed?

I want a list / tree to show
WHAT MAY BE ADDED AFTER DATA1 AND THE DOT something like

Data1.Recordset.Fields(i).Name
Data1.Recordset.Fields(i).Type
Data1.Recordset.Fields.Count
Data1.Database.Tabledefs(i).Name
             
and whatever I don't know.

Regards.

Victor
I see.  Look in the VB help file for properties of a Database Object and a TableDef object.

From the Help File:
---------------------------
Database Object
---------------------------
A Database object contains these collections, methods, and properties.

Collections
---------------------------
Containers
Properties
QueryDefs
Recordsets (Default for )
Relations
TableDefs (Default for )

Methods
---------------------------
Close
CreateProperty
CreateQueryDef
CreateRelation
CreateTableDef
Execute
MakeReplica
NewPassword
OpenRecordset
PopulatePartialSynchronize

Properties
---------------------------
CollatingOrder
Connect
Connection
DesignMasterID
Name
QueryTimeout
RecordsAffected
Replicable (user-defined)
ReplicaID
Updatable
V1xNullBehavior
Version
---------------------------
---------------------------

---------------------------
TableDef Object
---------------------------
A TableDef object contains these collections, methods, and properties.

Collections
---------------------------
Fields (Default)
Indexes
Properties
Methods
CreateField
CreateIndex
CreateProperty
OpenRecordset
RefreshLink

Properties
---------------------------
Attributes
ConflictTable
Connect
DateCreated
KeepLocal (user-defined)
LastUpdated
Name
RecordCount
Replicable (user-defined)
ReplicaFilter
SourceTableName
Updatable
ValidationRule
ValidationText
---------------------------
---------------------------

For the fields object, look at the help file.