Solved

How to use MS Access database for Delphi 6?

Posted on 2001-08-27
6
314 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:mnasman
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 22

Expert Comment

by:mnasman
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

19 Experts available now in Live!

Get 1:1 Help Now