Solved

How to use MS Access database for Delphi 6?

Posted on 2001-08-27
6
338 Views
Last Modified: 2010-04-06
Hi, Experts.

Could you please tell me how How to use MS Access database for Delphi 6?

I created a database call "test.mdb" using MS Access. I created an alias in the database desktop and chose driver type as "MSACCESS" and path is "c:\copy\test.mdb"; But when click on "connect" button, it said: "unrecognised database format".

Thanks.



0
Comment
Question by:jl2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Expert Comment

by:alshaikh
ID: 6430762
Most likely this is due to the BDE Access driver version support.

I recommend that you make an ODBC connection to your database, which will make it automatically accessible from your BDE based applications, without the need to define an alias for it.

A second solution that I actually prefer is, using ADO connection, which is available in both Delphi 6 and 5.


If you need more help, please let me know.


Regards,
0
 
LVL 7

Accepted Solution

by:
Motaz earned 100 total points
ID: 6430829
You can use ADO instead of BDE components, you don't need to make any alias in your computer or at the computer you want to deploy your application in. Moreover you don't need to distribute BDE libraries, you need only to distribute MDAC if the deployed computer contains no office or Access application.

ADO and Access Databases:

To use ADO for accessing Access databases do the followings:

- Drop ADOConnection from ADO page
- On ConnectionString property of the ADOConnection component, click (...) button and click Build.
- Select Microsoft Jet 4.0 OLE DB Provider
- Click on Connection tab and select your Access database file.
- Turn LoginPrompt to False if you write the login name and password in your connection
- Drop ADOTable or ADOQuery
- In ADOTable or ADOQuery Connection property select Connection1
- ADOTable and ADOQuery are datasets so that they can treated as any normal BDE TTable and TQuery. You can drop a DataSource and any data controls to be linked with your Access table.

0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6430880
Hello

  BDE support MS Access 97 and previous versions, if you want to use MS Access 2000 and later, you have to use ADO, and I prefer ADO it cuz it's faster than BDE, to use ADO in ur project:

1. Drop ADOTable on your form from ADO Tab.
2. Press on the ConnectionString Property for the ADOTable> then build
3. from provider window choose "Microsoft Jet 4.0 OLE DB Provider", then press Next
4. from the connecion window, and select ur MDB file, and check on the Allow saving passoword, and blank password, then press test connection to see it the connection succeeded, then press ok > ok, and back to the form
5. Now just choose your from from the TableName property of the ADOTable.

  I hope that work fine with you

Best regards
Mohamemd Nasman
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6430884
Sorry Motaz, I open the page before you post ur comment
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6435965
Don't worry Mohammed, the good thing that we have the same thoughts:)

Motaz
0
 

Author Comment

by:jl2001
ID: 6438622
Thanks all! Your comments are very helpful. But I can only choose one for the answer.

Thanks again!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question