
Figure B.1. The Data Access Object model.
This appendix is designed as a reference to all the objects included in the DAO object model. The collections and objects are listed in alphabetical order with tables indicating and describing all the available methods and properties available to each.
The Containers collection contains all the Container objects that are part of a database. A container name can be Database, Tables, or Relations. Table B.1 shows the method of the Containers collection; Table B.2 shows its property. Table B.3 lists the properties of the Container object.
| METHOD | DESCRIPTION |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | The number of objects in the collection |
| PROPERTY | DESCRIPTION |
| AllPermissions | Returns all permissions for the user named by UserName, including those that are inherited from the user's group as well as the user's specific permissions |
| Inherit | Sets or returns a value that indicates whether the document will receive a default Permissions property setting |
| Name | Sets a user-defined name for the DAO object |
| Owner | Sets the owner of the current Container object |
| Permissions | Sets the permissions available for the user, of the current Container object, named by UserName |
| UserName | Indicates the name of the user for the current Container object |
The Database object is a member of the Databases collection. The Database object is a means of access to an open database file. Table B.4 shows the method of the Databases collection; Table B.5 shows its property. Table B.6 lists the methods of the Database object, and Table B.7 lists the properties.
| METHOD | DESCRIPTION |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Returns the number of objects in the collection |
| METHOD | DESCRIPTION |
| Close | Closes the current Database object |
| Creates a new Property object | |
| Creates a new QueryDef object and adds it to the QueryDefs collection | |
| CreateRelation | Creates a new Relation object and adds it to the Relations collection |
| CreateTableDef | Creates a new TableDef object and adds it to the TableDefs collection |
| Execute | Executes the specified SQL action query |
| MakeReplica | Makes a new replica from another database replica |
| NewPassword | Assigns a new password to the Database object |
| OpenRecordset | Creates a new Recordset object and adds it to the Recordsets collection |
| PopulatePartial | Synchronizes changes in a partial replica with the full replica and repopulates the partial replica based on the current replica filters |
| Synchronize | Synchronizes two replicas |
| PROPERTY | DESCRIPTION |
| CollatingOrder | Returns the sequence of the sort order in text and string comparison |
| Connect | Returns information about the source |
| Connection | Returns a connection object corresponding to the current Database object |
| Name | Sets a user-defined name for the DAO object |
| QueryTimeout | Indicates the number of seconds to wait until an error is reported when executing a query |
| RecordsAffected | Indicates the number of records that were affected by the last call of the Execute method |
| Replicable | Indicates whether the current Database object can be replicated |
| ReplicaID | Returns a 16-byte value that uniquely identifies a database replica |
| Transactions | Indicates whether an object supports transactions |
| Updatable | Indicates whether an object can be updated |
| V1xNullBehavior | Indicates whether zero-length strings in Text or Memo fields are converted to NULL values |
| Version | Indicates the DAO version currently in use |
The Documents collection contains all the Document objects for a specific type of Microsoft Jet Database object (Database, Table or Query, or Relationship). Table B.8 shows the method of the Documents collection, and Table B.9 shows its property. Table B.10 shows the Document object method; Table B.11 lists its properties.
| METHOD | DESCRIPTION |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Returns the number of objects in the collection |
| METHOD | DESCRIPTION |
| CreateProperty | Creates a new user-defined Property object |
| PROPERTY | DESCRIPTION |
| AllPermissions | Indicates all the permissions belonging to the current user of the document that are specific as well as inherited from its group |
| Container | Returns the name of the Container object to which the current Document object belongs |
| DateCreated | Returns the date and time the current object was created |
| LastUpdated | Returns the date and time the current object was last modified |
| KeepLocal | Indicates that the current object is not to be replicated |
| Name | Sets a user-defined name for the DAO object |
| Owner | Returns the user that is considered the owner of the current Document object |
| Permissions | Returns the permissions specific to the current user of the document |
| Replicable | Indicates whether the current Document object can be replicated |
| UserName | Returns the name of the current user of the document |
DBEngine is the only part of the DAO object model that is not a collection; rather it is only an object that contains and controls all the other components of the DAO object model. Table B.12 lists the methods of the DBEngine object; Table B.13 lists the properties.
| METHOD | DESCRIPTION |
| BeginTrans | Begins transaction for the database engine |
| CommitTrans | Commits changes since the last call to the BeginTrans method |
| Rollback | Rolls back to the state before the call to the BeginTrans method |
| CompactDatabase | Compacts an existing database into a new database |
| CreateDatabase | Creates a new Database object, saves it to disk, and returns the opened Database object |
| CreateWorkspace | Creates a new Workspace object and appends it to the Workspaces collection |
| Idle | Allows the Jet engine to complete any pending tasks by suspending data processing |
| OpenConnection | Opens a connection to an ODBC data source |
| OpenDatabase | Opens a database and returns a Database object that represents it |
| RegisterDatabase | Enters connection information for an ODBC data source in the Windows Registry |
| RepairDatabase | Tries to repair a corrupt Jet database |
| SetOption | Temporarily overrides values in the Windows Registry for the Microsoft Jet database engine |
| PROPERTY | DESCRIPTION |
| DefaultType | Sets the type of Workspace object to be used when the next Workspace object is created |
| DefaultUser | Sets the username of the default Workspace object to be created |
| DefaultPassword | Sets the password used to create the default Workspace object when it is initiated |
| IniPath | Indicates the path of the information used from the Windows Registry about the Jet database engine |
| LoginTimeout | Returns the number of seconds before an error occurs when attempting to log on to an ODBC data base |
| SystemDB | Returns the path and name of the current workgroup information file |
| Version | Indicates the DAO version currently in use |
The Errors collection is a collection of Error objects pertaining to individual DAO operation failures. Table B.14 shows the Errors collection method, and Table B.15 shows its property. Table B.16 lists the properties of the Error object.
| METHOD | DESCRIPTION |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Returns the number of objects in the collection |
| PROPERTY | DESCRIPTION |
| Description | Indicates the description of the current error |
| HelpContext | Returns the context ID for a topic in a Windows Help file |
| HelpFile | Returns the name of a Windows Help file |
| Number | Indicates the number referring to the current error |
| Source | Indicates the source of the current error |
The Fields collection belongs to the Index, QueryDef, Relation, and TableDef objects. The collection is composed of all the Field objects of the corresponding object. The Field object is used to access the value of that field and its definition. Table B.17 lists the methods of the Fields collection, and Table B.18 shows its property. Table B.19 lists the Field object's methods, and Table B.20 lists its properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| AppendChunk | Appends a string to a Memo or Long Binary field |
| CreateProperty | Creates a new user-defined Property object |
| GetChunk | Returns a portion of a Memo or Long Binary field |
| PROPERTY | DESCRIPTION |
| AllowZeroLength | Indicates whether a zero-length value can be stored in the field |
| Attributes | Returns information containing characteristics of an object |
| CollatingOrder | Returns the sequence of the sort order in text and string comparison |
| DataUpdatable | Indicates whether the object's data can be updated |
| DefaultValue | Returns a default value given to the field if no other value is specified |
| FieldSize | Indicates the number of bytes used in the database for a Memo or Long Binary field |
| ForeignName | Returns the name of a Field object in a foreign table that corresponds to a field in a primary table for a relationship |
| Name | Sets a user-defined name for the DAO object |
| OrdinalPosition | Indicates a numbered position of the current field in the Fields collection |
| OriginalValue | Returns the value of the field when the last batch update began |
| Required | Indicates whether the field must be given a value |
| Size | Returns the size in length of the field |
| SourceField | Indicates the name of the field that is the original source of the data for the current Field object |
| SourceTable | Sets the name of the table that is the original source of the data for a Field object |
| Type | Returns the operational type of object |
| ValidateOnSet | Indicates whether a Field object value is indicated when its Value property is set |
| ValidationRule | Returns the value that validates data in a field as it is changed or added to a table |
| ValidationText | Indicates the message that your application displays if the value of the Field object does not satisfy the validation rule |
| Value | Returns the actual data stored in the field |
| VisibleValue | Returns the value that is newer than the OriginalValue property as determined by a batch update conflict |
The Groups collection contains Group objects of a workspace or user. A Group object is a group of users who have common access permissions. Table B.21 lists the methods of the Groups collection, and Table B.22 shows its property. Table B.23 shows the Group object's method, and Table B.24 lists its properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| CreateUser | Creates a new user object for the current group |
| PROPERTY | DESCRIPTION |
| Name | Sets a user-defined name for the DAO object |
| PID | Returns a group personal identifier |
Indexes Collection, Index Object
The Indexes collection contains all the Index objects pertaining to a particular TableDef object. The Index object specifies the order of the records in a table. Table B.25 lists the Indexes collection methods, and Table B.26 shows the Indexes collection property. Table B.27 lists the Index object methods, and Table B.28 lists the Index object properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| CreateField | Creates a Field object and appends it to the Fields collection |
| CreateProperty | Creates a Property object |
| PROPERTY | DESCRIPTION |
| Clustered | Indicates whether the Index object is a clustered index |
| DistinctCount | Indicates the number of unique values for the Index object |
| Foreign | Indicates whether the current Index object represents a foreign key |
| IgnoreNulls | Indicates whether NULL values in the fields of the current Index object are allowed |
| Name | Sets a user-defined name for the DAO object |
| Primary | Indicates that the current index is the primary key |
| Required | Indicates that the values of the Field objects that make up the current Index object must be specified |
| Unique | Indicates that the combination of the Field object values that make up the current Index object are unique |
The Parameters collection contains all the Parameter objects of a QueryDef object. A Parameter object contains a value that is passed to a QueryDef object. Table B.29 shows the Parameters collection method, and Table B.30 shows its property. Table B.31 lists the Parameter object properties.
| METHOD | DESCRIPTION |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| PROPERTY | DESCRIPTION |
| Direction | Indicates whether the object represents an input, an output, both, or the return value from the procedure |
| Name | Sets a user-defined name for the DAO object |
| Type | Indicates the operational type of object |
| Value | Sets the value of the Parameter object |
QueryDefs Collection, QueryDef Object
The QueryDefs collection holds all QueryDef objects for a database. The QueryDef object is a stored definition of a query in a Jet database file or a temporary definition in an ODBCDirect workspace. Table B.32 lists the methods of the QueryDefs collection, and Table B.33 shows its property. Table B.34 lists the methods of the QueryDef object, and Table B.35 lists its properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| Cancel | Cancels execution of an asynchronous method call |
| Close | Closes the current recordset |
| CreateProperty | Creates a new user-defined Property object |
| Execute | Executes the current query definition |
| OpenRecordset | Creates a new Recordset object and appends it to the Recordsets collection |
| DESCRIPTION | |
| CacheSize | Returns the number of locally cached records that will be received from an ODBC data source |
| Connect | Indicates the information about the source of an open connection |
| DateCreated | Returns the date and time the current object was created |
| LastUpdated | Returns the date and time the current object was last modified |
| KeepLocal | Indicates that the current object is not to be replicated |
| LogMessages | Indicates whether messages from an ODBC data source are recorded |
| MaxRecords | Indicates the maximum return from the query |
| Name | Sets a user-defined name for the DAO object |
| ODBCTimeout | Returns a number, indicating the number of seconds to wait before a timeout error occurs when a QueryDef is executed on an ODBC database |
| Prepare | Indicates whether the query should be prepared on the server as a temporary stored procedure |
| RecordsAffected | Indicates the number of records affected by the last call to the Execute method |
| Replicable | Indicates whether the current object can be replicated |
| ReturnsRecords | Indicates whether a SQL pass-through query returns records |
| SQL | Sets the SQL statement that composes the current query |
| StillExecuting | Indicates whether an asynchronous operation has finished executing |
| Type | Returns the operational type of object |
| Updatable | Indicates whether the QueryDef object can be updated |
The Recordsets collection contains all open Recordset objects of a database. Through the Recordset object, data can be manipulated and accessed. Recordset types include Table, Dynaset, Snapshot, Forward-only, and Dynamic. All recordsets are accessed by rows (records) and columns (fields). Table B.36 shows the method of the Recordsets collection, and Table B.37 shows its property. Table B.38 lists the methods of the Recordset object, and Table B.39 lists its properties.
| DESCRIPTION | |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| AddNew | Adds a new record to the current recordset |
| Cancel | Cancels operation of an asynchronous operation |
| CancelUpdate | Cancels any pending updates |
| Clone | Creates a duplicate of the current Recordset object |
| Close | Closes the current recordset |
| CopyQueryDef | Returns a QueryDef object that is a copy of the QueryDef used to create the current Recordset object |
| Delete | Deletes the current record |
| Edit | Prepares the current record for editing by Visual Basic code |
| FillCache | Fills all or part of a Recordset object that contains data from an ODBC data source |
| FindFirst | Finds the first record that matches specified criteria |
| FindLast | Finds the last record that matches specified criteria |
| FindNext | Finds the next record that matches specified criteria |
| FindPrevious | Finds the previous record that matches specified criteria |
| GetRows | Returns multiple rows from the current Recordset object |
| Move | Moves the position of the current record in the current Recordset object |
| MoveFirst | Moves to the first record of the recordset |
| MoveLast | Moves to the last record of the recordset |
| MoveNext | Moves to the next record of the recordset |
| MovePrevious | Moves to the previous record of the recordset |
| NextRecordset | Returns the next set of records returned by a multipart selection query in an OpenRecordset call |
| OpenRecordset | Sets the recordset to a new selection of records |
| Requery | Performs the specified query again to update the recordset with the current database information |
| Seek | Finds a match to a specific criteria by using an index of the current recordset |
| Update | Saves changes specified to the recordset from the AddNew or Edit method |
| PROPERTY | DESCRIPTION |
| AbsolutePosition | Sets the record pointer position within the Recordset object |
| BatchCollisionCount | Indicates the number of records that did not complete the last batch update |
| BatchCollisions | Returns an array of bookmarks indicating which rows generated collisions in the last batch update operation |
| BatchSize | Indicates the number of statements sent back to the server in each batch |
| BOF | Returns the beginning-of-file indicator |
| EOF | Returns the end-of-file indicator |
| Bookmark | Returns the bookmark for a record position |
| Bookmarkable | Returns a Boolean stating the capability to create bookmarks |
| CacheSize | Indicates the number of locally cached records that will be received from an ODBC data source |
| CacheStart | Returns a bookmark to the first record in a Recordset object containing data to be locally cached from an ODBC data source |
| Connection | Sets the Connection object that owns the current Recordset object |
| DateCreated | Returns the date and time the current object was created |
| LastUpdated | Returns the date and time the current object was last modified |
| EditMode | Indicates the state of editing for the current record |
| Filter | Sets a filter to determine the records included in a subsequently opened Recordset object |
| Index | Sets the current index for the Recordset object |
| LastModified | Returns a bookmark to the last edited or new record of the current Recordset object |
| LockEdits | Indicates the type of locking that is in effect while editing |
| Name | Sets a user-defined name for the DAO object |
| NoMatch | Indicates whether a record was found after using either the Seek method or a Find method |
| PercentPosition | Returns an approximate percentage of the current record position as compared to the entire record population of the current Recordset object |
| RecordCount | Indicates the number of records in the current Recordset object |
| RecordStatus | Returns the update status of a current record that is part of a batch update |
| Restartable | Indicates whether the current object supports the ReQuery method |
| Sort | Sets the order for records in the current Recordset object |
| StillExecuting | Indicates whether an asynchronous operation has finished |
| Transactions | Indicates whether the object supports transactions |
| Type | Indicates the operational type of the object |
| Updatable | Indicates whether the current object can be updated |
| UpdateOptions | Indicates the way in which batch updates are executed |
| ValidationRule | Returns the value that validates data in a field as it is changed or added to a table |
| ValidationText | Sets a message that your application displays if the value of the Field object does not satisfy the validation rule |
Relations Collection, Relation Object
The Relations collection contains all the Relation objects stored in a database. A Relation object indicates the relationship between fields and tables or queries of a Jet database. Table B.40 lists the methods of the Relations collection, and Table B.41 shows its property. Table B.42 shows the method of the Relation object, and Table B.43 lists its properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| CreateField | Creates a Field object and appends it to the Fields collection |
| PROPERTY | DESCRIPTION |
| Attributes | Returns characteristics of the current Relation object |
| ForeignTable | Sets the name of the current Relation object's foreign table |
| Name | Sets a user-defined name for the DAO object |
| PartialReplica | Indicates whether the Relation object should be included in a partial replica |
| Table | Returns the name of the current Relation object's primary table |
| ValidationText | Sets a message that your application displays if the value of the Field object does not satisfy the validation rule |
The TableDefs collection contains all TableDef objects for a given database. The TableDef object is used to access and manipulate a tables definition. Table B.44 lists the methods of the TableDefs collection, and Table B.45 shows its property. Table B.46 lists the methods of the TableDef object, and Table B.47 lists its properties.
| METHOD | DESCRIPTION |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | DESCRIPTION |
| Count | Indicates the number of objects in the collection |
| METHOD | DESCRIPTION |
| CreateField | Creates a new Field object for the current TableDef and appends it to the Fields collection |
| CreateIndex | Creates a new Index object for the current TableDef object and appends it to the Indexes collection |
| CreateProperty | Creates a new user-defined Property object for the current TableDef object |
| OpenRecordset | Creates a new Recordset object and appends it to the Recordsets collection |
RefreshLink Updates the connection information for a linked table
| PROPERTY | DESCRIPTION |
| Attributes | Indicates the characteristics of the current TableDef object |
| ConflictTable | Returns the name of a conflict table containing the database records that conflicted during the synchronization of two replicas |
| Connect | Sets information about the source of an open connection |
| DateCreated | Returns the date and time the current object was created |
| LastUpdated | Returns the date and time the current object was last modified |
| KeepLocal | Indicates that the object is not to be replicated with replication of the database |
| Name | Sets a user-defined name for the DAO object |
| RecordCount | Indicates the number of records in a table |
| Replicable | Indicates whether the object is replicable |
| ReplicaFilter | Indicates what subset of records is replicated from a full replica |
| SourceTableName | Indicates the name of a linked table or the name of a base table |
| Updatable | Indicates whether you can change the DAO object |
| ValidationRule | Sets a value that validates data in a field as it is changed or added to a table |
| ValidationText | Sets a message that your application displays if the value of the Field object does not satisfy the validation rule |
The Workspaces collection contains all active Workspace objects that are not hidden. A Workspace object defines how the Visual Basic application interacts with data. Table B.48 lists the methods of the Workspaces collection, and Table B.49 shows its property. Table B.50 lists the methods of the Workspace object, and Table B.51 lists its properties.
| METHOD | Description |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | Description |
| Count | Indicates the number of objects in the collection |
| METHOD | Description |
| BeginTrans | Begins transaction for the workspace |
| CommitTrans | Commits changes since the last call to the BeginTrans method |
| Rollback | Rolls back to the workspace state before the call to the BeginTrans method |
| Close | Closes the Workspace object |
| CreateDatabase | Creates a new Database object |
| CreateGroup | Creates a new Group object |
| CreateUser | Creates a new User object |
| OpenConnection | Opens a connection object for an ODBC data source |
| OpenDatabase | Opens a database with the current workspace |
| PROPERTY | Description |
| DefaultCursorDriver | Returns the type of cursor driver used on the connection created by the call to OpenConnection or OpenDatabase |
| IsolateODBCTrans | Indicates whether multiple transactions that involve the same Jet-connected ODBC data source are isolated |
| LoginTimeout | Indicates the number of seconds before an error occurs while attempting to log on to an ODBC database |
| Name | Sets a user-defined name for the DAO object |
| Type | Indicates the operational type of object |
| UserName | Returns the owner of the current workspace object |
A Users collection contains all User objects belonging to a particular Workspace or Group object. The User object refers to a specific user account with various permissions. Table B.52 lists the methods of the Users collection, and Table B.53 shows its property. Table B.54 lists the methods of the User object, and Table B.55 lists its properties.
| METHOD | Description |
| Append | Adds a new object to the collection |
| Delete | Removes an object from the collection |
| Refresh | Updates the contents of the collection to reflect the current status of the database |
| PROPERTY | Description |
| Count | Indicates the number of objects in the collection |
| METHOD | Description |
| CreateGroup | Creates a new Group object for the current user |
| NewPassword | Changes the password of the current user |
| PROPERTY | Description |
| Name | Sets the name of the current User object |
| Password | Sets the password for the current User object |
| PID | Returns a personal identifier for the current User object |
© Copyright, Macmillan Computer Publishing. All rights reserved.