+ Reply to Thread
Results 1 to 4 of 4

Querying an Access Database from Excel VBA

  1. #1
    Chaplain Doug
    Guest

    Querying an Access Database from Excel VBA

    Excel 2003, Access 2003. I want to access a query within an Access database.
    The database is called "FEOpen.mdb" and the Query is called "Projects List."
    I guess I may be asking how to populate a recordset from Excel VBA using the
    Access query. Any help will be appreciated. God bless and thanks.
    --
    Dr. Doug Pruiett
    Good News Jail & Prison Ministry
    www.goodnewsjail.org

  2. #2
    sebastienm
    Guest

    RE: Querying an Access Database from Excel VBA

    Hi,
    Are you trying to display the result of a query in a sheet?
    If so, excel has a built-in feature that does just that and does not require
    code:
    1- in a new blank sheet
    2- menu Data > Get (or Import) External Data > New Database Query. The
    'Choose Data Source' dialog pops up.
    3- make sure the checkbox 'Use the Query Wizard...' (at the bottom) is
    checked. Choose MS Access Database and click ok. The 'Select Database' dialog
    pops up.
    4- browse to you db file and select it. click ok. The Query Wizard pops up.
    5- The Query Wizard displays a list of tables and queries. Select one and
    follow the wizard steps.

    The wizard is good to build simple queries. Now, if yours is too complex
    then in step 3 above, uncheck the 'Use the Query Qizard...'. In that case MS
    Query opens (instead of the query wizard) and you should have much more
    flexilbility there.

    i hope this helps,
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "Chaplain Doug" wrote:

    > Excel 2003, Access 2003. I want to access a query within an Access database.
    > The database is called "FEOpen.mdb" and the Query is called "Projects List."
    > I guess I may be asking how to populate a recordset from Excel VBA using the
    > Access query. Any help will be appreciated. God bless and thanks.
    > --
    > Dr. Doug Pruiett
    > Good News Jail & Prison Ministry
    > www.goodnewsjail.org


  3. #3
    Chaplain Doug
    Guest

    RE: Querying an Access Database from Excel VBA

    Dear Sabastien:

    Actually I want to populate a record set and do some manipulations and
    calculations on the data. Hence, the built-in "external data" capability of
    Excel will not suffice. Can you suggest some code that would use the query
    and place the results in a record set that I could then process through?
    Thanks for any help. God bless.
    --
    Dr. Doug Pruiett
    Good News Jail & Prison Ministry
    www.goodnewsjail.org


    "sebastienm" wrote:

    > Hi,
    > Are you trying to display the result of a query in a sheet?
    > If so, excel has a built-in feature that does just that and does not require
    > code:
    > 1- in a new blank sheet
    > 2- menu Data > Get (or Import) External Data > New Database Query. The
    > 'Choose Data Source' dialog pops up.
    > 3- make sure the checkbox 'Use the Query Wizard...' (at the bottom) is
    > checked. Choose MS Access Database and click ok. The 'Select Database' dialog
    > pops up.
    > 4- browse to you db file and select it. click ok. The Query Wizard pops up.
    > 5- The Query Wizard displays a list of tables and queries. Select one and
    > follow the wizard steps.
    >
    > The wizard is good to build simple queries. Now, if yours is too complex
    > then in step 3 above, uncheck the 'Use the Query Qizard...'. In that case MS
    > Query opens (instead of the query wizard) and you should have much more
    > flexilbility there.
    >
    > i hope this helps,
    > --
    > Regards,
    > Sébastien
    > <http://www.ondemandanalysis.com>
    >
    >
    > "Chaplain Doug" wrote:
    >
    > > Excel 2003, Access 2003. I want to access a query within an Access database.
    > > The database is called "FEOpen.mdb" and the Query is called "Projects List."
    > > I guess I may be asking how to populate a recordset from Excel VBA using the
    > > Access query. Any help will be appreciated. God bless and thanks.
    > > --
    > > Dr. Doug Pruiett
    > > Good News Jail & Prison Ministry
    > > www.goodnewsjail.org


  4. #4
    Dick Kusleika
    Guest

    Re: Querying an Access Database from Excel VBA

    Chaplain Doug wrote:
    > Dear Sabastien:
    >
    > Actually I want to populate a record set and do some manipulations and
    > calculations on the data. Hence, the built-in "external data"
    > capability of Excel will not suffice. Can you suggest some code that
    > would use the query and place the results in a record set that I
    > could then process through? Thanks for any help. God bless.
    >


    Try here

    http://www.*****-blog.com/archives/2...ordset-basics/


    --
    **** Kusleika
    MVP - Excel
    Daily Dose of Excel
    http://www.*****-blog.com



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1