?
Solved

Delphi & Access

Posted on 2002-04-26
6
Medium Priority
?
331 Views
Last Modified: 2010-04-04
Need to connect a delphi application (delphi 6) to an access (2000 version) database.

What are the steps that I need to take or any clues please?

Thank you
0
Comment
Question by:donly9
[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
 
LVL 17

Expert Comment

by:inthe
ID: 6972723
steps to connect to access via odbc:

Odbc:

1:   Open Control Panel, and then select ODBC DataSources (32bit) .
2:   When the Data Source Administrator appears, Click Add.
3:   find the one that says  Microsoft Access Driver (*.mdb)
     click it and click finish.
4:   A dialog will popup called ODBC Microsoft Access Setup
5:   in "data source name" edit box well call it "MyAccess"
6:   description well say is "tesing msaccess connection".
7:   click select and find your .mdb file click ok to select it.
8:   click "advanced" and make sure login name and password are blank.
9:   close advanced.
10:  close microsoft access setup dialog
11:  close the  Data Source Administrator.

delphi:

1:  start or restart delphi if its already running.
2:  start a new project
3:  drop a ttable,tdbgrid,tdatasource,tdatabase on form.

    in object inspector:

4:  datasource1 dataset : table1
5:  dbgrid datasource   : datasource1
6:  database1 aliasname : MyAccess  
7:  database1 databasename : MyAccessDB //type a name instead of selecting one
8:  database1 loginprompt : false
9:  table1 databasename : MyAccessDB  //the name you typed is now selectable
10: table1 tablename : select a table
11: database1 connected : true
12: table1 active : true

or connect via ADO (from another q):

- 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 1

Expert Comment

by:MBo
ID: 6972724
The simplest case example:

a) add adotable,datasource and dbgrid

b) build adotable connectionstring, for example
1)Microsoft Jet...
2)choose database (C:\Program Files\Borland Shared\Data\dbdemos.mdb)
and login if you need

c) choose adotable tablename (country)

d) datasource1.dataset - adotable1

e) dbgrid1.datasource -  datasource1

if you make adotable Active, data are visible in design-time

Of course, you may use other db-aware components and ado components as well.
This is just starting point

0
 

Author Comment

by:donly9
ID: 6972874
Thank you inthe
0
Independent Software Vendors: 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!

 
LVL 2

Expert Comment

by:mikepj
ID: 7002839
www.opus.ch is what I use with Delphi 5 and Access 97.  Very fast...and free.
0
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 7003336
hi,
can you please accept one of comments as answer ,this closes the question from the open question lists.
thanks
Regards Barry
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9004173
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from inthe

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

777 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