by Jim Karabatsos - GUI Computing
This is a short preview of a new product from OPUS Software.
DirectAccess is a tool that allows you to access JET databases from Delphi 2, without using the ODBC MDB driver. Since its release, one of the major obstacles to the wide-spread adoption of Delphi as a development environment has been its lack of ability to access MDB database files natively. While it was always possible to use the Microsoft ODBC drivers from Delphi, performance was less than satisfactory and this was quite rightly seen as unsuitable for production use.
DirectAccess is still in (late) beta testing. We do not normally review unreleased products because we prefer to discuss software we have actually used, and is available for purchase. However, the interest in a product like this is so high that we thought we would make an exception this time.
DirectAccess is a tool for Delphi 2 only, which means that it works only on Win32 platforms (Win95 and Windows/NT). It allows you to access JET 3.0 databases from Delphi using the built-in data-aware controls. It does this by providing a DLL, ODAPI32.DLL, which exports a significant subset of the functions exported by Borland's own IDAPI32.DLL. It also provides a program that will patch the compiled BDE unit (BDE.DCU) so that it loads and calls ODAPI32.DLL, instead of IDAPI32.DLL. In this way, all the built-in and add-on Delphi data-aware controls continue to work as before, except that they now talk to MDBs instead of dBase or Paradox databases.
DirectAccess currently supports access to JET tables, using either the Delphi TTable or TQuery components. You can also use the TQuery component, with a JET SQL statement, for dynamic SQL access to JET databases. The current beta release does not support access to JET parameterised queries, but this is expected in the shipping product or soon thereafter, and is seen as a high-priority requirement by the developers.
Database performance is quite good, on a par with VB or Access database speed, although your user interface and processing code will be significantly faster in Delphi than either of these tools. (Of course, if your program is predominantly limited by data access speed, you may not see much difference.)
DirectAccess makes use of the Data Access Objects (DAO) OLE interface to JET, exposed and documented by JET 3.0. Before you groan about the performance hit you need to be aware that the JET DAO interface is a dual OLE interface. What this means is that it supports both the generic IDispatch OLE Automation interface, and more specific object interfaces that correspond to the OLE objects supported by DAO. The IDispatch interface allows any automation controller to use DAO by querying the library for information and interfaces at run-time. While this is very flexible, it also imposes quite an overhead, in fact about five times as much overhead as the alternative - which is to expose separate interfaces that the calling application must know about ahead of time and which can be accessed much more quickly. This is somewhat like early-bound vs late-bound objects in VB.
Fortunately, DAO exposes interfaces like IRecordset, IDatabase and IWorkspace that are of this latter type. These are the interfaces used by Access, Visual Basic and Visual C++ to control JET, so they truly are the "native" JET interface. DirectAccess uses these same interfaces, so it is no surprise that its speed is comparable.
DirectAccess is only available for Delphi 2 because it needs the new OLE features introduced in that version. This means you cannot use it if you need to target Win16 platforms. You cannot use both DirectAccess and the BDE in the same program (which is not a problem because you can always attach the dBase, of Paradox tables, to the MDB). DirectAccess does not interfere with the use of the BDE by other programs; you can have separate programs where each uses either the BDE or DirectAccess.
One issue that you need to be aware of is licensing. In order to use DirectAccess, and to deploy application using DirectAccess, you need to be a registered owner of VB4 Pro or EE, the Access 95 Developers Toolkit, or Visual C++ version 4 (or later) - as these give you the licence to distribute the JET database engine with your applications. Alternatively, your users must have a copy of Microsoft Office which contains a non-redistributable licence for JET. You should clarify the legal position for yourself before deploying applications using JET.
The current beta of DirectAccess requires you to manually install the product, which involves directly editing the registry both to set up keys so that the DLL can be found, and to create database aliases. You need to be careful when doing this. The shipping version should come with an install program and an alias creation program, so these steps will not be necessary.
All in all, this looks like a very useful tool for Delphi 2 programmers. This tool is distributed by Real Solutions and will retail in Australia for $265 until the end of May (be quick!), $335 thereafter. It is available in the USA for around the USD$250 price point. Distributed on 3.5" floppy. Manual in Rich Text Format on the disk. If you are interested in a copy, email email@example.com.