Office 97 Access

ODBCDirect

Using DAO to access ODBC Databases without loading the Microsoft Jet Database Engine

Microsoft Access 97 introduces ODBCDirect , a technology that enables you to work with ODBC database servers without loading the Microsoft Jet database engine. ODBCDirect relies on the Microsoft DAO 3.5 object model, so that you can easily modify your existing DAO code to take advantage of ODBCDirect. Microsoft DAO 3.5 includes new objects, methods, and properties to support ODBCDirect.

The most important advantage to using ODBCDirect is that it 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. In previous versions, loading the jet engine resulted in higher overhead and slower performance. Using DAO, your code becomes faster and more efficient by providing direct access to ODBC data sources. ODBCDirect consumes fewer resources on the client side. The ODBC server is responsible for all query processing.

Other advantages are as follows:

  • ODBCDirect gives you improved access to server-specific features that aren't available by using ODBC through Microsoft Jet. For example, for servers that support cursor specification, ODBCDirect allows you to specify where cursors are located, whether locally or on the server. In addition, to interact with stored procedures at the server level, you can specify input values and check return values, which you can't do when using Microsoft Jet.
  • ODBCDirect also supports asynchronous queries. When you execute a query, you don't have to wait for the query to finish running before you begin another operation. You can track the query's execution by checking the StillExecuting property.
  • ODBCDirect supports batch updating, enabling you to cache Recordset object changes locally and then submit these changes to the server in a single batch.
  • With ODBCDirect, you can create simple cursorless result sets, or more complex cursors. You can also run queries that return any number of result sets. You can limit the number of rows returned and monitor all the messages and errors generated by the remote data source without affecting the performance of the executing query.

Creating an ODBCDirect Workspace

The ODBCDirect workspace provides an alternative when you only need to execute queries or stored procedures against a back-end server, such as Microsoft SQL Server, or when your client application needs the specific capabilities of ODBC, such as batch updates or asynchronous query execution.

You can create an ODBCDirect workspace by specifying the constant dbUseODBC for the type argument of the CreateWorkspace method. You can also specify that an ODBCDirect workspace be created by default by setting the DefaultType property of the DBEngine object.

Once you've created an ODBCDirect workspace, you can use specific DAO objects, properties, and methods to work with data on the ODBC database server.


Data Access Object Model for ODBCDirect Workspaces

DAO Model Image


For Data Access Objects Overview, Click Here

Back...

 


  Random Thoughts...
What has four legs and an arm? A happy pit bull.


Copyright© 1996-1999, Baarns Consulting Group, Inc. - All rights reserved.