Getting Access database table names using Matlab

I am trying to get a list of all the tables in an Access database using Matlab.

I still use actxobject and can successfully run database queries, but all the methods that I read here have failed.

I keep getting the error "No read permission on MSysObjects". The request is executed within the framework of the Access program, but the implementation of my program does not allow me to save the request there.

So, my question is: is there a way to list all Access database tables through Matlab?

+3
source share
1 answer

Consider this code:

conn = actxserver('ADODB.Connection');
connString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Nwind.mdb';
conn.Open(connString);

rs = conn.OpenSchema('adSchemaTables').GetRows;
tableNames = rs(3, ismember(rs(4,:),'TABLE') );

and the result:

>> tableNames'
ans = 
    'Categories'
    'Customers'
    'Employees'
    'Order Details'
    'Orders'
    'Products'
    'Shippers'
    'Suppliers'
+5
source

Source: https://habr.com/ru/post/1751370/


All Articles