Forum

Appending two acces...
 
Notifications
Clear all

Appending two access databases in one step

2 Posts
2 Users
0 Reactions
125 Views
(@brucellyn)
Posts: 4
Active Member
Topic starter
 

Hi there,

I have the following situation: on monthly base I receive two access databases with the same layout, one for each user, and use this data to do some checks.

So I was importing this two databases individually into a query and appending them.

But I faced some issues doing this:

1) not every month I received two files, sometimes it was just a file for all users

2) the name of the files change every month, so rename and change folder every time wouldn't be efficient

I created a table with the folder path and did some coding to get the files directly, without rename/change folder.

My intention was to get only the access databases in this folder and then appending both with #"Combined Binaries", but it didn't work 🙁

With that I get just one database, not both..

Any insights on how to do the steps to get the database whether it is one or two files, without have to do two versions (for 1 and 2 DB)?

Thanks!

let

    Source = Excel.CurrentWorkbook(){[Name="Folder"]}[Content],

    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Folder", type text}}),

    Folder = #"Changed Type"{0}[Folder],

    Custom1 = Folder.Files(Folder),

    #"Filtered Rows" = Table.SelectRows(Custom1, each ([Extension] = ".accdb")),

    #"Combined Binaries" = Binary.Combine(#"Filtered Rows"[Content]),

    #"Imported Access" = Access.Database(#"Combined Binaries"),

    _Reconciliacao = #"Imported Access"{[Schema="",Item="Reconciliacao"]}[Data],

 
Posted : 19/04/2018 9:03 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Carolyne,

You can't get Access files (.accdb) from a folder. You can only connect to an Access database and query the tables and queries in the database.

It seems a strange thing to send you Access files every month. Can you not just connect to them directly and refresh your queries once a month?

Mynda

 
Posted : 20/04/2018 7:25 pm
Share: