Solved

using MS Access in delphi

Posted on 2000-02-23
2
390 Views
Last Modified: 2010-04-04
I would like to know how to use a database built in Access on a Delphi form
0
Comment
Question by:EddieChrisMurchoe
2 Comments
 

Accepted Solution

by:
perkley earned 50 total points
ID: 2571673
Use a component like Diamond Access, which will directly access the Microsoft Access database file, bypassing the BDE.  It gives it a lot more speed.

You can find Diamond Access at this URL:
http://www.islamov.com/diamond/

Question is do you know how to use other database files on a Delphi Form?  If so, this should make it a piece of cake.

The only problem, is if you need to distribute the file, then the computer it runs on needs to have the DAO installed.  If you purchase the Microsoft Developers CD, it comes with the runtime of Microsoft Access and the license to distribute the DAO.

This should answer your question, but if not, let me know.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2574693
Hi
you dont need to use (and pay) for diamond components when you can use odbc for free instead :

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 some name
8:  database1 loginprompt : false
9:  table1 databasename : MyAccessDB  //some name is now selectable
10: table1 tablename : select a table
11: database1 connected : true
12: table1 active : true

now carry on and do whatever as normally would for db..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

23 Experts available now in Live!

Get 1:1 Help Now