Solved

Delphi & Access

Posted on 2002-04-26
6
329 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 50 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi: ForceDirectory plain function 7 50
Tvertscrollbox like a whatsapp layout 5 51
Delphi problems to abort a printjob 9 34
Delphi Seattle StructureView color 1 21
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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