Solved

How do I connect to an Access Database?

Posted on 1997-05-19
3
141 Views
Last Modified: 2010-04-04
I am new to Delphi and am having trouble connecting to my access database :
"d:\Clients\Property_Guide\Software\property.mdb".

I have used the BDE and created a new driver called ODBC_Access and selected the Access driver as the default.
I set the database name to the path and db name above.
I then create an alias called property with an alias type of
ODBC_Access. I fill in the database name as "property.mdb" and the path as "d:\Clients\Property_Guide\Software" for the alias. When I go into Delphi 2 and try to connect my TTable component, I manage to set the DatabaseName property to "Property", but when I try to set the TableName property
It comes up and asks me for a user name and password, which it shouldn't do.

I'm not sure where I'm going wrong so any help will be appreciated. Thanks in advance.
0
Comment
Question by:scotslad
3 Comments
 
LVL 2

Accepted Solution

by:
vorlon earned 50 total points
ID: 1336490
Try this:
When creating a new OBDB driver, select Access 2.0 for MS Office instead of Access Data or Access Files. Then, proceed as usual. It should work...

Hope this helps.
0
 

Author Comment

by:scotslad
ID: 1336491
There is no option to select "Access 2.0 for MS Office" in Delphi 2. This option is in Delphi 1 but not Delphi 2. In the file "Odbcinst.ini" there is an entry for "Access 2.0 for MS Office (*.mdb)" however this option doesn't appear in the list of options when you create a new ODBC driver. The options that appear are all 32 bit. If it is possible to get the option appearing in this list then let me know how to do it. Basically I need a step by step guide to connecting to an access database from within Delphi. For all I know I am missing a stage out or not filling the correct values in the appropriate fields or something. Cheers.
0
 

Expert Comment

by:tfwong
ID: 1336492
Simple.

Just add the 'Database' Component from Data Access page to your form and set 'LoginPrompt' to False.
0

Featured Post

Highfive Gives IT Their Time Back

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!

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

13 Experts available now in Live!

Get 1:1 Help Now