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?