AccDaoEn.Zip  
  
Version: 4.0 04/30/1999  
  
Author: Jos Mara Gias  
email: sigekom@arrakis.es  
Home: http://www.arrakis.es/~sigecom  
  
Delphi 4 + DAO 3.5  
  
Freeware  
  
- Tool to work with MSAccess 97 tables, with DAO 3.5 and with BDE that performs the following tasks:  
    
Creates and erases Aliases in the BDE   
  
Creates MsAccess 97 .mdb database files  
  
Accesses .mdb files with the option of displaying or not the MSAccess Login Prompt so that the user's name and the Password (This option is only valid for those MsAccess files that have no users name and password previously defined)    
    
Converts and adds dBase/Paradox files to a .mdb database file either with DAO 3.5 or with the BDE  
  
Performs SQL queries to tables either with DAO 3.5 or the BDE   
    
Visualizes data of a .mdb database table  
  
Visualizes fields and indices of MsAccess tables MsAccess and their parameters  
  
Adds and deletes erases indices in MsAccess tables  
  
Packs and repairs MsAccess 97 .mdb files  
  
Since this product is considered Freeware, the author is not liable for it usage.  
  
You can copy, distribute, publish it in a page Web / Book / CD, etc. and use it but you must always keep the complete original file.  You dont need the authors permission.  
  
- Source code for Unit F_Access.pas: 15 Euros  
  
#Up to now, I have always given the source code of several programs and their components freely, but experience has taught me that since they have been used to create Shareware programs, I have changed my mind and I ask some money to cover my expenses.   
  
- Requirements  
  
  Delphi 4  
  
  DAO 3.5 installed in their computer  
  
  #Microsoft DAO 3.5 is part of some Microsoft applications Office Proffesional, Visual Basic, Visual C, etc.  
  
    If you don't have these applications, you must contact Microsoft or get an application that redistributes it.  
  
  DAO 3.5 configured in the BDE  
  
     #To configure it, start up the BDEs administrator and select the following:  
  
       Configuration / Drivers / Native / MSACCESS / DLL32 / IDDA3532.DLL  
    
Quit the administrator to save the changes   
	  
- Installation  
  
  This project uses standard components of Delphi, for what it is enough with to create a subdirectory  with the desired name and decompress the file AccessDao40.zip there.  
  
  If you have the requirements mentioned in the previous point, you merely will have to compile the AccessDao.dpr file.   
  
- Operation  
  
  When you start up the program for the first time, it will generate the following:   
  
  - An MsAccess alias in the BDE named AccessDao  
  
  - A database file named MsAccess AccessDao.mdb  
  
  - A file named dBase DbfExample.dbf  
  
  - A file named Paradox ParadoxExample.db  
  
  Select MsAccess .mdb's database that you want to use, for example AccessDao that has just been created  
  
  Since when creating AccessDao, the database will be empty, we can test it by adding other data tables such as DbfExample.dbf or ParadoxExample.db  
  
  First, select the desired table with the button ' Table to append', and then try to add with the Append DAO' or ' Append BDE'  
  
 If you have the CheckBox ' Overwrite' selected, the table will be substituted in case this already exists.  
  
 It is in big files where you find the biggest difference.  The option of adding directly with the DAO 3.5 is four times quicker than the same done with the BDE  
  
  #With the option of adding with the DAO, I have only verified the operation with the most usual type of fields, so, probably, with Byte, Ole, etc.type of fields you may encounter some problems. If you use this type of fields, verify the results by adding and comparing results with the option of the BDE before giving it for good  
  
  If you have added one of the two example tables, you will realize that in the Memo of the GroupBox ' SQL Query' has a prewritten consultation so that you can prove the difference between performing it with the DAO or with the BDE  
  
  When carrying out the query, the most records meet the filter conditions, the most speed you will realize in the BDEs option and slowest will be the DAOs option.  This is the reason why I recommend you to use BDE when performing SQL queries.   
  
 To be able to continue using standard components, the queries performed with the DAO 3.5, are returned in the table ' TableQuery' and in the file TmpAccessDao.Dbf, but this is included only as a comparison and I dont recommend this option to you.   
  
  #If you are performing a Query in a table different from those of example, you must adapt the query to your needs.  Keep in mind that in MsAccess the sintax of SQL is something different to that of dBase or Paradox. For additional information, consult the MsAccess or of the DAO help files.  
  
  #If you perform a query on a table that a text field, and it contains an empty record, if you are  working while Delphi is running, it will generate a Variant conversion error of conversion that won't appear when executing the file directly AccessDao.exe. It is protected with a try  
  
Now that you have the database generated, you can perform maintenance, repair tasks, while packing or repairing it with the bottons located on the top right hand corner.   
  
  From the Fields, or Index comboboxes, you can visualize the fields and indices of the selected table.  You can also create new indices of a field of a table, with the name that is indicated in the combobox of the index.  You can also delete the index hat you select with the delete button.    
    
  #In the file F_Access.pas (registered Users) you can find an example of the necessary code to create indices with the Dao 3.5 (See function CreateAccessFields (..))  
  
  As of each file that opens up, it automatically generates an Alias in the BDE, a small utility has been included to be able to visualize those Aliases and their parameters, as well as the option to delete them. It is really very simple to perform all these operations.  
  
  In each operation that is performed, a small window is displayed in which it is indicated the time utilized as long as the miliseconds that Windows displays.   
  
- Conclusion  
  
  To work correctly with MsAccess it is only necessary to introduce the appropriate parameters in the BDE, define an Alias correctly, and for most applications, use the standard Delphi components.  It is only necessary to have DAO handy when performing those tasks such as creating tables, indices, in those in which using BDE is slow, such as, for example, adding files that go with the example and to pack and repair the database when it fails.   
  
- File of functions F_Access.pas  
  
  If you are interested in this file you can visit our WEB page  
  
     http://www.arrakis.es/~sigecom   
  
  where you will find the way of getting it, and with which you will be sent additional information of some more interesting places to get more information.   
  
  In the WEB, you will also find other files (Author's Freeware in their last versions,) along with links to many interesting Delphi sites.   
  
Enjoy programming with Delphi!!