Solved

How do I connect to an Access Database?

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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