Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to use MS Access database for Delphi 6?

Posted on 2001-08-27
6
Medium Priority
?
396 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 400 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

636 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