Data Access Objects
Data Access Objects
Data Access Objects
A data access objects is a collection of object classes that model the structure of a relational database system. They provide properties and methods that allow the user to accomplish all the operations needed to manage such a system ,including features for creating database ,defining tables ,navigating and querying a database. A DAO database object, represented by class CDaoDatabase, represents a connection to a database through which we can operate on the data .
DAO contd.
DAO supplies a hierarchical set of objects that use the Microsoft Jet database engine to access data and database structure in: Microsoft Jet (.MDB) databases ODBC data sources, using an ODBC driver .
DatabaseName Property
Returns or sets the name and location of the source of data for a Data control. object.DatabaseName [ = pathname ] For ODBC databases, such as SQL Server and Oracle, this property can be left blank if the control's Connect property identifies a data source name (DSN) that identifies an ODBC data source entry in the registry.
RecordSource Property
Setting
Returns or sets the underlying table, SQL statement, or stored procedure. object.RecordSource [= value ]
Description The name of one of the tables defined in the Database object's TableDefs collection. A valid SQL string using syntax appropriate for the data source. The name of a stored procedure in the database. When using DAO, the name of one of the QueryDef objects in the Database object's QueryDefs collection.
Database Collections
Each DAO database COLLECTION objects contains the following objects from different classes: DBengine:The DBengine is the top level database objects and corresponds to the jet database engine.This object is used to set database engine system parametes and default workspace.
Workspace(class CDAOworkspace) Database (class CDAOdatabase) Tabledefs (class CDAOtabledefs) querydefs (class CDAOquerydefs) recordsets (class CDAOrecordset)
Class
DAO object
Workspace Database Tabledef
Remarks Manages a transaction space and provides access to the database engine. Represents a connection to a database. Used to examine and manipulate the structure of a table. Used to store queries in a database. we can create recordsets from a querydef or use it to execute action or SQL pass-through queries. Used to manage a result set, a set of records based on a table or selected by a query. responds to all DAO errors by throwing exceptions of this type.
CDaoQueryDef
Querydef
CDaoRecordset
Recordset
CDaoException
Error
ODBC
Open Database Connectivity defines a standard set of routines with which an application can access data in a data source. Applications can use ODBC by using Data Access Objects (DAO) OR ADO.
VisData is an application that was created using Visual Basic. A built version of VisData is used as an add-in accessible from the Add-Ins menu .