DAO is a well-known, easy to use object model for database services, including Microsoft Jet, ODBC, and in the future, OLE DB. DAO is also multi-lingual-you can use it from VB and VBA environments, FoxPro, and Visual C++. Your knowledge of DAO allows you to access a variety of data sources from a variety of development environments. DAO is also Microsoft's strategic object model for Database Access. Therefore, you can assume that it is going to be around for a long while.
dbEngine > Workspace > Database > TableDef
dbEngine > Workspace > Database > QueryDef
dbEngine > Workspace > User > Group
dbEngine > Workspace > Group > User
The dbEngine object contains Workspaces, and workspaces contain Databases. Within Access, only one workspace can be open, so the current database is always Workspaces(0).Databases(0). Before you can refer to other objects, you need a database type variable, so DAO references usually begin with:
Dim db as database
Set db = dbEngine(0)(0)
For i = 0 to db.TableDefs(0).Fields.Count - 1 Debug.print db.TableDefs(0).Fields(i).NameNextFor i = 0 to db.TableDefs(0).Properties.Count - 1 Debug.print db.TableDefs(0).Properties(i).Name & " = "; Debug.print db.Tabledefs(0).Properties(i)Next.