Solved

How to use MS Access database for Delphi 6?

Posted on 2001-08-27
6
315 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now