Search code examples
ms-accessimportsassas-macro

Import All Access 2016 tables into SAS 9.4 (from multiple .accdb DBs)


I am trying to import all tables from a multiple Access (2016) DBs into SAS (9.4), as opposed to doing a bunch of proc import statements. I cannot use the OLEDB or ODBC as I do not have proper drivers installed on my computer. Any tips as to how to go about doing this would be greatly appreciated! Thank you!


Solution

  • Simply assign a library to database path. All tables will show as datasets. SAS maintains both Access and Excel facilities for easy library assignment.

    Please note this is a live connection and live tables and changes here including deleting datasets will remove such tables. With Access you will see the locked file (.laccb) in use with below connection.

    ** ASSIGN LIBNAME;
    libname accdata "C:\Path\To\Database.accdb";
    
    ** UNASSIGN LIBNAME;
    libname accdata clear;