Solved

How do I connect to an Access Database?

Posted on 1997-05-19
3
163 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
[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
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

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!

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…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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