Board index » delphi » How to access a MS Access 97 database in Delphi 3 !

How to access a MS Access 97 database in Delphi 3 !

I Have been trying to access a MS Access 97 database but my Database Desktop
giver problems !
How can I configure DBE!

Thanks in advance

 

Re:How to access a MS Access 97 database in Delphi 3 !


Quote
s.po...@usa.net wrote:
> I Have been trying to access a MS Access 97 database but my Database Desktop
> giver problems !
> How can I configure DBE!

> Thanks in advance

First, go the Borland (Inprise, whatever) site and download the 4.5 version of
BDE.
After installing that, start the BDE Administrator app. Click the Configuration
tab.
Expand the Drivers, Native tree.
Select the MSACCESS entry and change the DLL32 entry to IDDA3532.DLL.
This will enable you to access Access without userid's and passwords.

Now in your application, put a database component on your form and double-click
the component.
Fill in the DatabaseName field to anything you want.
Select Driver Name of MSACCESS.
Turn of the Login Prompt checkbox
Add the name of the database you want in the Parameter section:
DATABASE NAME=

Here's a code snippet to fill in that field from yoour app:
  for i := 0 to (Database1.Params.Count - 1) do
  begin
   loc := Pos ('DATABASE NAME=', Database1.Params[i]);

   if loc <> 0 then
    Database1.Params[i] := 'DATABASE NAME=' + db_name;
  end;

where db_name is the full path name of your database.

Now add a Table component to your form. Set the DatabaseName property of the
Table to the DatabaseName property of your Database component. Set the TableName
property of your table component to the name of the table in your database.

To connect to the database set the Connected property of the database component
to true and the Active property of the Table component to true. I find it's best
to do this under program control. That way you only have a connection open while
you are actively working with the DB.

Tony

Other Threads