Add Review of Diamond Access 1.35

Let's get this out in the open, I am a fan of DBase files. You might think being a fan of DBase files would be unusual in today's SQL mania world. To which I reply, look at all of the applications you have installe, most of them have an import filter for DBase. The DBase file format is reliable, stable, I've never lost data (compared to Rbase or Paradox) and it is an industry standard. When Delphi was released it came with native drivers for DBase and everything worked, and my world seemed to be ok. Then when Microsoft released Access I started to like Access files. All tables, queries, reports in one easy to handle file. Great. But Delphi and the BDE only supported these files through ODBC. This combination was cumbersome to install and slow.

I ended up staying with DBase when working with Delphi. Delphi 3 held out the hope for improvement by providing native drivers for Microsoft Access and Delphi 4 increased this hope further by supporting the MS Access 97 format. However, serious database programming is still hindered by megabytes of BDE DLLs . Even worse, the BDE native driver barely does the job. Ever tried to create a new MS Access database with the BDE driver? Or tried to access the queries in the MDB file? You won't succeed!

Lately I discovered Diamond Access, a BDE replacement which accesses Microsoft Access databases directly through Data Access Objects 3.5 (DAO). The code is written by Timur Islamov. Despite some bad experiences with other tools, which patched my system DCUs and caused me to reinstall Delphi 4, I decided to give Diamond Access a try.

Diamond Access installed without any hassles. Just open the package, tell it to install and you will find the following four new components on the Diamond Access tab in your component palette:


The first three components do basically the same things as the corresponding TDatabase, TTable and TQuery components included with Delphi. But they all use DAO (Data Access Objects) to set up the connection to the Microsoft Access database rather then going through the BDE. I was impressed by the small footprint the engine left in the program. Overall it only adds about 100KB to your program. All data-aware components I tried. provided by either Inprise or select third-party vendors (Raize, RX), worked without any problems.

You do not have to know anything about DAO programming to use Diamond Access. Just put a TDAODatabase on your form and connect it to the Access database, put a TDAOTable for each table on your form and connect it to the TDAODatabase and link your data-aware components through a standard TDatasource. There you go. No hassle, no new things to learn. Even the properties are the same as in the corresponding Delphi BDE components.

Diamond Access can definitely do more than the native BDE Access driver. One of the nice features in Microsoft Access is the ability to keep your SQL queries in your database file. Even though this is similar to stored procedures in SQL databases, the native Access driver in the BDE does not give you access to these queries. At this point the Diamond Access TDAOQueryDef comes into play.

You use the TDAOQueryDef component in the same way you would use a regular query. As soon as the component is connected to your database you can access the queries in the MDB file through the QueryDefName property. As a programmer you will have the advantage of using MS Access and it's query builder (which is extremely slick) to visually develop your queries and use the tested queries in your code. Plus you can still separate the query code from the program code, a great way to implement business rules.

Microsoft Access also has the ability to create a query that gets it's data from another query. This feature is not readily available through Delphi and the BDE Access driver and requires quite some effort to implement . Diamond Access on the other hand makes this a trivial task. The TDAOQueryDef only needs to call the query which you need to return the data you want to see (and which you specified in QueryDefName) and will handle the necessary calls automatically. Even the creation of a new database can be handled with Diamond Access. By using the _DBEngine object and a call to the CreateDatabase method it is possible to create a database from your code. An example of this functionality is included in the demos that come with Diamond Access.

Is Diamond Access fast? Any query I ran seemed to respond in the blink of an eye. To get some figures I created a large table with 142,000 records which I accessed through both Diamond Access and the native MS Access driver of the BDE. Out of interest I also exported the table to the DBase IV format and ran the same procedure with the BDE standard driver. The test program steps through the table, retrieves the value from one field, splits it at the first blank in two strings which it writes back to two fields in the same record.

In the table below are the times it took to perform the above mentioned task with the 3 different drivers (time in minutes:seconds).

As you can see Diamond Access is faster than the native BDE driver for Microsoft Access but not as fast as the DBase driver. It's interesting to note the difference in speed between running the tests in the IDE and a standalone executable.

There are some downsides to Diamond Access. You have to familiarize yourself with DAO methods (which you find in the MS Access help file) to get the most out of this product. Error handling is more difficult as all of your errors come from an OLE-object and require some additional work to be used appropriately. And obviously you lose portability.

The documentation of Diamond Access left me with somewhat mixed feelings. The documentation is done in HTML format. It covers the units, properties and events but does not mention error handling or usage of _DBEngine. As the documentation is not in standard Winhelp or WinHTML format you cannot integrate it with the Delphi help. And obviously you have to go back to Microsoft Access for information on DAO.

Overall I think this is a great replacement of the BDE if you do serious database programming based on the Microsoft Access data format. The combination of using Diamond Access to develop your application and Microsoft Access to implement your business rules and SQL queries is a tremendous combination which should save a developer a lot of hours during the development process.
Related Discussions
    Well, in design I think there is already an issue. Backend is more then just a database with which you connect. There should be a complete layer...
    One of the quirks of Delphi is that classes in the same unit can access protected and private methods and variables. Borland does this a lot in...
  • HOW TO CALL A FUNC IN A DLL WRITTEN BY DELPHI IN VC6.0? (2001-01-11 08:36:48)
    Mr williamda: Thank you.I am sorry I can not accept your answer.I specify the "stdcall" for my function and I don't use 'string' type. I can...
  • PRINTING A PDF FORM (2001-01-07 05:57:11)
    Hello Tom, If you find a delphi solution to bypass the acrobat Printer i am very interrested. Actually i am printing a lot of invoice to the...
  • MODBC MTABLE.POST - WHY DOESN'T WORK? (2001-01-07 11:32:50)
    Thanks for help :) I use Access database, and my 'ID' field is the standard unique field generated by Access. I've tried to set the field type...
  • HOW CAN I ACCESS BTRIEVE DATA FILES (2001-01-24 08:38:59)
    Try downloading the Btrieve programmer's guide : Good luck ...
  • INDEX PROBLEMS (2001-01-12 10:28:01)
    I've worked with a configuration like yours. Please specify the method you use to access Pervasive database (ODBC, DBE, ADOExpress, Titan, P.SQL...
  • YOUR FAVORITE BDE ALTERNATIVE? (2001-01-13 12:44:19)
    I joined the company I am currently working for three years ago. MsAccess databases were managed with the BDE. Since we ship our application to...
    It is my experience that slow machines are more quite to have AV. It seems that Windows does not find the time to finish a current process that...
  • A TECHNICAL QUESTION ABOUT ADO (2001-01-16 09:18:42)
    If you use MsAccess, things will behave the same way as with BDE.
Latest News
Submit News Form Past News
Latest Forum Entries