Results 1 to 3 of 3

Thread: Conncting Access database to Excel spreadsheet

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Conncting Access database to Excel spreadsheet

    I am writing an VBA in Excel 2003 to query an Access database.
    I have previously written a VB.net program where the data is entered and reports made on this Access database.

    In Excel I have created a button and when I click on it I want to connect to the database then later I will use queries to read the Access database.

    I have only written two lines of code for this button:
    Code:
    Dim cn As Object
          
        'Set cn = CreateObject("ADOBD.Connection")
        Set cn = CreateObject("OLEBD.Connection")
    With both ADODB & OLEDB I get the error 'ActiveX component cannot create object'.

    What am I doing wrong?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Conncting Access database to Excel spreadsheet

    typo... BD <> DB

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    350

    Re: Conncting Access database to Excel spreadsheet

    Thanks.

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width