MATLAB Answers


How to read .accdb file in MATLAB using ODBC

Asked by Chandra Shekhar on 4 Jul 2013
I have access file 'Database.accdb', how to read this file in MATLAB.
I have created ODBC datasource, if i read this ODBC file using 'database' function. But it will not contain any message in it.
conn =
Instance: 'datbaseaccess'
UserName: ''
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: []
Handle: [1x1 sun.jdbc.odbc.JdbcOdbcConnection]
TimeOut: 0
AutoCommit: 'on'
Type: 'Database Object'
Please suggest me any one, how to read this database file in MATLAB, i am new to database toolbox.


Sign in to comment.

1 Answer

Answer by Friedrich
on 4 Jul 2013
 Accepted Answer

you don't rad the file using the database command. You establish a connection with the database file. If Message is empty it means that the connection is fine. Now you can extract data using commands like fetch and exec.


Show 1 older comment
Have you tried the MATLAB documentation? You need to know SQL in order to query values.
Or maybe start using the querybuilder in order to get started and let MATLAB generate the SQL query for you,
thanks Friedrich, i got it now.

Sign in to comment.