I'm trying to add records from Excel to an Access 2010 database. I seem to have OK code when adding to a database from a previous version but when I try:-
I get the above error message.
I've tried a few variations of:-
but this seems to be a connection problem I can't solve. It has been suggested that adding Microsoft Office 12.0 Object Library to 'Tools | References' would help. I downloaded the appropriate file from microsoft.com but it "failed to install".
I thought this might be true as I got some code to download from Access that appears to work just fine:-
Any idea please?
Many thanks,
Des.
Code:
Set db = OpenDatabase("C:\Documents and Settings\des.lavender\Access\LBLTest1.accdb")
I get the above error message.
I've tried a few variations of:-
Code:
Dim db As DAO.Database
but this seems to be a connection problem I can't solve. It has been suggested that adding Microsoft Office 12.0 Object Library to 'Tools | References' would help. I downloaded the appropriate file from microsoft.com but it "failed to install".
I thought this might be true as I got some code to download from Access that appears to work just fine:-
Code:
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( "OLEDB;[b]Provider=Microsoft.ACE.OLEDB.12.0[/b];Password="""";User ID=Admin;Data Source=C:\Documents and Settings\des.lavender\Access\LBLTest1.accdb;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=6;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False"), Destination:=Sheets("Sheet" & T).Range("$A$1")).QueryTable
Any idea please?
Many thanks,
Des.