Board index » delphi » Open MS-ACCESS file (.MDB)

Open MS-ACCESS file (.MDB)

I'd like to open MS-Access file for read/write using BDE and Delphi.
I ran BDE Administrator first, set database name of 'MSAccess97 database'
to my .MDB file. Then I tried to open tables in the .MDB file using
Database Desktop. But it asked me for a password. Isn't the password
'masterkey' if I use SYSDBA as user name? But it didn't accept it.
I got a message : "Invalid connection string attribute DATABASE".
I just installed my Delphi, so I'm sure no one changed my password.
Beside, why I need a password? I'm just simply trying to open a .MDB
file....

any suggestions are appreciated.  Thanks!

Jason

 

Re:Open MS-ACCESS file (.MDB)


You are using the wrong BDE driver. There are two possibilities:

1. Using the BDE MSACCESS driver (DAO 3.5 needs to be installed)
- Start the BDE Administrator
- Set Configuration | Drivers | Native | MSACCESS | DLL32 to IDDA3532.DLL
(or IDDAO32.DLL for MS Access 95)
- Create an alias of type MSACCESS
- Select the *.mdb file for DATABASE NAME

2. Using the ODBC MS Access driver
- Start the 32-bit ODBC Administrator
- Create a DSN of type Microsoft Access Driver (*.mdb)
- Select the *.mdb file for Database
- You can use the DSN as a BDE alias (there is no need to create an alias)

"JC" <jc1234...@yahoo.com> schreef in bericht
news:8kh1cm$me7$1@news.seed.net.tw...

Quote
> I'd like to open MS-Access file for read/write using BDE and Delphi.
> I ran BDE Administrator first, set database name of 'MSAccess97 database'
> to my .MDB file. Then I tried to open tables in the .MDB file using
> Database Desktop. But it asked me for a password. Isn't the password
> 'masterkey' if I use SYSDBA as user name? But it didn't accept it.
> I got a message : "Invalid connection string attribute DATABASE".
> I just installed my Delphi, so I'm sure no one changed my password.
> Beside, why I need a password? I'm just simply trying to open a .MDB
> file....

> any suggestions are appreciated.  Thanks!

> Jason

Re:Open MS-ACCESS file (.MDB)


Hi JC

If you get an answer to this, please let me know - I know the answer is
simple but I haven't found out what it is either

thanks in anticipation
Ford

Quote
JC wrote:
> I'd like to open MS-Access file for read/write using BDE and Delphi.
> I ran BDE Administrator first, set database name of 'MSAccess97 database'
> to my .MDB file. Then I tried to open tables in the .MDB file using
> Database Desktop. But it asked me for a password. Isn't the password
> 'masterkey' if I use SYSDBA as user name? But it didn't accept it.
> I got a message : "Invalid connection string attribute DATABASE".
> I just installed my Delphi, so I'm sure no one changed my password.
> Beside, why I need a password? I'm just simply trying to open a .MDB
> file....

> any suggestions are appreciated.  Thanks!

> Jason

Re:Open MS-ACCESS file (.MDB)


You are using the wrong BDE alias. The alias for "MS Access 97 database" is
actually an ODBC DSN and not a BDE alias. I suspect that you don't want to
use ODBC, but the BDE MSACCESS driver (requires DAO 3.5 to be installed. DAO
3.5 is part of MS Office 97).

To use a MS Access 97 database with the BDE you have to take the following
steps:

1. Start the BDE administrator
2. Set Configuration | Drivers | Native | MSACCESS | DLL32 to IDDA3532.DLL
to select DAO 3.5 (needed for MS Access 97 databases, set to IDDAO32.DLL for
DAO 3.0/MS Access 95 databases).
3. Select Databases | New..., select the MSACCESS driver and enter a unique
BDE alias.
4. Set DATABASE NAME to the *.mdb MS Access database file, LANGDRIVER to
'Access General' and USER NAME to 'Admin' (if you are working with protected
databases you also have to set the SYSTEM DATABASE).
5. Close the BDE administrator.
6. Start Delphi and put a TDatabase, a TTable, a TDataSource and a TDBGrid
on a form.
7. For the TDatabase set.AliasName to the alias created in the BDE
Administrator, set DatabaseName to a unique name and LoginPrompt to False
(if you have a protected database and want the user to enter the
name/password you need to set this to True or if you want an automatic
password you have to add PASSWORD=xxx to Params).
8. For the TTable set DatabaseName to the DatabaseName of the TDatabase,
select a TableName and optionally an IndexName. Next, set Active to True.
9. For the TDataSource set DataSet to the TTable
10. For the TDBGrid set DataSource to the TDataSource.

Now you should be able to see the contents of the table in the grid !

"Ford Cropley" <F.D.Crop...@cableinet.co.uk> schreef in bericht
news:39CA6104.A342345A@cableinet.co.uk...

Quote
> Hi JC

> If you get an answer to this, please let me know - I know the answer is
> simple but I haven't found out what it is either

> thanks in anticipation
> Ford

> JC wrote:

> > I'd like to open MS-Access file for read/write using BDE and Delphi.
> > I ran BDE Administrator first, set database name of 'MSAccess97
database'
> > to my .MDB file. Then I tried to open tables in the .MDB file using
> > Database Desktop. But it asked me for a password. Isn't the password
> > 'masterkey' if I use SYSDBA as user name? But it didn't accept it.
> > I got a message : "Invalid connection string attribute DATABASE".
> > I just installed my Delphi, so I'm sure no one changed my password.
> > Beside, why I need a password? I'm just simply trying to open a .MDB
> > file....

> > any suggestions are appreciated.  Thanks!

> > Jason

Other Threads