Board index » delphi » Basics: Read MS Access DB

Basics: Read MS Access DB

I can't seem to connect to a MS Access DB, even though I just installed BDE
4.51.

Using Database Explorer, I created an alias. For the driver, there was a
choice of "Microsoft Access Driver (*.mdb)" and "MSACCESS". Is there any
difference between those? I tried both.

I then started a new project and added a Data Source, Table, and Grid, and
connected them together. For the database, I selected my alias. Then when I
tried to choose a table, I got a login box asking for my user name and
password. I can't get past that point. The database shouldn't have a
password -- It's just a simple sample I created with Access on my local
drive.

Am I missing some simple step? Also, should I be able to read an Access
table using Database Desktop or Database Explorer?

Thanks.

 

Re:Basics: Read MS Access DB


Richard, Here is a reply from Neil which answers your problem I think.  I'll
repeat it here.
"
If you are using Access 97 make sure you have BDE 4.51 (can be downloaded
from Borland).

Run the BDE config utility and set the DLL32 option under Configuration
- Drivers - Native - MSACCESS to IDDA3532.DLL for Access 97
(IDDA032.DLL is for Access95).

Add a TDatabase, set the driver name to MSACCESS, login prompt to false,
database name to any identifying string you choose, add "DATABASE
NAME=FILE_NAME.mdb" to the parameters, and connected to true.

Then add a TTable, set database name to the same identifying string as
before, and proceed as usual to work with the table.

Neil McCrossin
Veitch Lister Consulting
Brisbane, Australia"

David

Re:Basics: Read MS Access DB


Quote
>Using Database Explorer, I created an alias. For the driver, there was a
>choice of "Microsoft Access Driver (*.mdb)" and "MSACCESS". Is there any
>difference between those? I tried both.

The first is an ODBC driver.
The second is the Native Access driver

Quote

>I then started a new project and added a Data Source, Table, and Grid, and
>connected them together. For the database, I selected my alias. Then when I
>tried to choose a table, I got a login box asking for my user name and
>password. I can't get past that point. The database shouldn't have a
>password -- It's just a simple sample I created with Access on my local
>drive.

Then just enter the user name and leave the password blank
If you have not configure a user name then it is Admin

Quote

>Am I missing some simple step?

you have to have DAO installed on any machine you want to use the Native access
driver with.

Quote
>Also, should I be able to read an Access
>table using Database Desktop or Database Explorer?

Yes once you have an alias properly set up.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Basics: Read MS Access DB


Thanks. I'm connected. The key seemed to be specifying the correct DLL in
the BDE config utility.

Some experimentation suggests that I only need to add a TDatabase (as
described in your quoted explanation from Neil) if I want to prevent the
login box.

At the login box, I just clicked OK (leaving both User Name and Password
blank) and it worked OK. Then, as an experiment (since I have very limited
DB experience), I tried using Database Desktop|Alias Mgr to add a user name
and/or password to see what would happen, but each time (in DB Desktop|Alias
Mgr) when I clicked OK, I got a message saying "Abnormal termination" and
then DB Desktop closed. (The database was not in use at the time.)

On this machine, I'm using BDE 4.51 and Access 97. Success.

On a different machine (at home), I used BDE 4.01 and Access 95, but was
unable to connect.

Other Threads