How can I access my Data.mdb database with Delphi?

Posted on 2006-04-06
Last Modified: 2010-04-05
Hi, im a newbie in programming and I was wondering how can I use a dbgrid for a .mdb Microsoft Access database I created (called Data.mdb). I have no idea what components to use, so I would be greatfull if someone could help me out.
Question by:fb132
    LVL 8

    Accepted Solution

    For Delphi 7, you could use ADO components.
    Drop an ADOConnection onto the form.
    Drop an ADOTable onto the form.

    You need to set the ConnectionString property for the ADOConnection, click the ... button, then click build.. For provider you could select Microsoft Jet.
    Then browse to select your mdb on the connection tab.
    You could also look at the advanced for permissions etc.

    You can now set the Connection property of the ADOTable to the ADOConnection.
    Then if you click on the TableName property of the ADOTable you should see a listing of the available tables/querys in your mdb. Select the one needed.

    To connect this to your DBGrid you need to drop a DataSource component onto the form. Then set its dataset property to your ADOTable.
    To connect to the grid set its datasource property to your Datasource component.

    Thats it. :)

    Obviously in code you would need to Open/Connect the ADOConnection. i.e  ADOConnection1.Connected := True ;
    Once connected you can then open your ADOTable.  ADOTable.Open ;

    This should be enough to get you started.
    LVL 9

    Expert Comment

    RickJ given a nice explanation above
    Also have a look into this. This is a nice tutorial step by step


    Author Comment

    Unfortunately I have Delphi 6, so my question is how do I get this ADO thing?
    LVL 8

    Expert Comment

    What version of Delphi 6?
    I was sure 6 Professional had an ADO tab on the component palette.

    Author Comment

    Standard, it has simply the regular components minus the ADO
    LVL 8

    Expert Comment

    I think you have a couple of options.
    I am sure that with earlier versions of delphi you could import a type library (An MS dll) that gave you base level ADO access.
    Or you could use some 3rd party components. There are free ones.
    I have to go now. (Very late here)
    Give me till the morning to dig up some exact details for you...??
    Or someone else may jump in and help.
    LVL 11

    Expert Comment

    I'm afraid you cannot use ADO or any other Database components with the standard edition of Delphi... no matter what version you are using.
    This is the whole point of Standard edition.... NO database access.
    Most of the components I've used or seen require that you have at least the professional version installed

    LVL 8

    Expert Comment

    Thanks calinutz.
    I have never used anything less than professional version.
    Do you know (and I am sure fb132 would like to know) are there any data components you can get for standard? I notice you said "most components" not all.
    Or is it a matter of having to upgrade?
    I had a quick search and found nothing for standard version.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    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…
    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…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, 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, fr…

    761 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

    16 Experts available now in Live!

    Get 1:1 Help Now