What's New in DAO?

 

DAO 3.5 introduces a new client/server connection mode, called "ODBCDirect." ODBCDirect establishes a connection directly to an ODBC data source, without loading the Microsoft Jet database engine into memory, and is useful in situations where specific features of ODBC are required.

For Microsoft Jet databases, there are also new interfaces to expose Microsoft Jet's new partial replication feature.

Note You can send DAO queries to a variety of different database servers with ODBCDirect, and different servers will recognize slightly different dialects of SQL. Therefore, context-sensitive Help is no longer provided for Microsoft Jet SQL, although online Help for Microsoft Jet SQL is still included through the Help menu. Be sure to check the appropriate reference documentation for the SQL dialect of your database server when using either ODBCDirect connections or pass-through queries in Microsoft Jet-connected client/server applications.

New DAO 3.5 Interfaces for ODBCDirect

?Connection object — A connection to an ODBC database.

 

?Cancel method (on Connection, QueryDef, and Recordset objects) — Cancels execution of an asynchronous operation.

 

?NextRecordset method (on Recordset objects) — Retrieves the next set of records, if any, returned by a query that returned multiple sets of records in an OpenRecordset call, and indicates whether it successfully retrieved another set of records.

 

?OpenConnection method (on Workspace objects) — Opens a Connection object on an ODBC data source.

 

?BatchCollisionCount property (on Recordset objects) — Returns the number of records that did not complete during the last batch update.

 

?BatchCollisions property (on Recordset objects) — Returns an array of bookmarks indicating the rows that generated collisions in the last batch update.

 

?BatchSize property (on Recordset objects) — Sets or returns the number of statements sent back to the server in each batch.

 

?Connection property (on Database and Recordset objects) — Returns the Connection object that corresponds to the Database, or that owns the Recordset.

 

?Database property (on Connection objects) — Returns the name of the Database object that corresponds to the Connection.

 

?DefaultCursorDriver property (on Workspace objects) — Sets or returns the type of cursor driver used for ODBCDirect Recordset objects.

 

?DefaultType property (on DBEngine object) — Indicates what type of workspace (Microsoft Jet or ODBCDirect) will be created by the next CreateWorkspace method call.

 

?Direction property (on Parameter objects) — Indicates whether a Parameter object represents an input parameter, an output parameter, or both, or if the parameter is the return value from a stored procedure.

 

?MaxRecords property (on QueryDef objects) — Sets or returns the maximum number of records to return from a query.

 

?OriginalValue property (on Field objects) — Returns the value of a Field in the database that existed when the last batch update began.

 

?Prepare property (on QueryDef objects) — Returns a value that indicates whether the query should be prepared on the server as a temporary stored procedure with the ODBC SQLPrepare function prior to execution, or just executed using the ODBC SQLExecDirect function.

 

?RecordStatus property (on Recordset objects) — Returns a value that indicates the update status of the current record if it is part of a batch update.

 

?StillExecuting property (on Connection, QueryDef, and Recordset objects) — Returns a value indicating whether or not an asynchronous operation has finished executing.

 

?UpdateOptions property (on Recordset objects) — Returns a value that indicates how the WHERE clause is constructed for each record during a batch update, and how the update should be executed.

 

?VisibleValue property (on Recordset objects) — Returns a value currently in the database that is newer than the OriginalValue property as determined by a batch update conflict.

New Capabilities with ODBCDirect

Server Connections

Available only in the ODBCDirect object model, the new Connection object contains information about a connection to an ODBC data source, such as the server name, the data source name, and so on. It is similar to a Database object, and will look very familiar if you've ever opened a Database object on an ODBC data source. In fact, a Connection object and a Database object represent different references to the same object, and new properties on each of these two object types allow you to obtain a reference to the other corresponding object, which simplifies the task of converting existing ODBC client applications that use Microsoft Jet to use ODBCDirect instead.

Batch Updates

A new batch update cursor is available for client applications that need to work with a cursor without holding locks on the server or issue update requests one record at a time. Instead, the client stores update information on many records in a local buffer (or "batch"), and then issues a batch update.

Because of the time lag between opening a Recordset and sending a batch of updates from that Recordset back to the server, other users have an opportunity to change the original data before your changes are sent to the server, so your changes "collide" with another user's changes. Several new features are available to help you determine where such collisions have occurred, following a batch update, and give you some options for resolving them.

Asynchronous Method Execution

The Execute, MoveLast, OpenConnection, and OpenRecordset methods feature the dbRunAsync option. This allows the client application to do other tasks (such as loading forms, and so on) while the method is executing. You can also poll to see whether the task is complete, and terminate an asynchronous task.

Client Support for ODBC Cursors

Four different Recordset types support the following ODBC cursor types:

ODBC Cursor

Recordset type

Dynamic

dbOpenDynamic (New in DAO 3.5)

Dynaset

dbOpenDynaset

Forward-Only

dbOpenForwardOnly (New in DAO 3.5)

Static

dbOpenSnapshot

 

New DAO 3.5 Interfaces for the Microsoft Jet Database Engine

?PopulatePartial method (on Database objects) — Synchronizes any changes in a partial replica with the full replica, clears all records in the partial replica, and then repopulates the partial replica based on the current replica filters.

 

?SetOption method (on DBEngine object) — Overrides the registry values for the Microsoft Jet database engine for the duration of the current instance of DAO.

 

?FieldSize property (on Field objects) — Replaces the FieldSize method. Syntactically, their usage is the same, so this will not require changes to your existing code.

 

?MaxRecords property (on QueryDef objects) — Sets or returns the maximum number of records to return from a query.

 

?ReplicaFilter property (on TableDef objects) — Returns a value that indicates which subset of records is replicated to that table from a full replica.

 

?PartialReplica property (on Relation objects) — Indicates which Relation object should be considered when populating a partial replica from a full replica.

New Capabilities with the Microsoft Jet Database Engine

Partial Replication

Version 3.5 of the Microsoft Jet database engine allows users to replicate portions of a table instead of the whole table (only row restrictions are permitted, not columns). There are two types of filters used in a partial replica — Boolean and relationship. Boolean filters select only rows that meet a certain criteria to limit the rows in a table that are replicated. DAO represents this filter with the ReplicaFilter property on a TableDef. Relationship filters enforce a relationship between partially replicated tables to limit the rows in a table that are replicated. With DAO, you can set the PartialReplica property on a Relation which allows that Relation to be used in partial replication.

New Recordset Type

In DAO 3.5, dbOpenForwardOnly is a new type argument for the OpenRecordset method. This new Recordset type behaves in the same way as a DAO 3.0 snapshot-type Recordset opened with the dbForwardOnly option.

Run-time Registry Override

The new SetOption method allows you to override Microsoft Jet Registry settings at run time. This lets you fine tune Microsoft Jet query performance, timeout delays, and so on.