Matlab Database toolbox - Excel

I got the database toolbox for R2012b, but I can't seem to connect to any database. I don't get any errors. I want to start off simple with an excel connection using database toolbox. Does anyone know how to establish a connection using database toolbox to a excel spreadsheet?
I can't find it anywhere in the documents.

3 Comments

Viral - please post the code that you are using to connect to a database so that someone can provide some guidance on what to do next.
Hello Geoff,
That's the issue. I have no idea on how to start the code to establish a connection to excel via database toolbox.
This is the code I use to connect to Access, but even that doesn't seem to work. When I use the following code for access and use the function isconnection, it returns false.
Access Database code:
dbpath = ['Z:\NBush Files\Holdings Files.mdb'];
url = [['jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DSN='';DBQ='] dbpath];
cone = database('','','','sun.jdbc.odbc.JdbcOdbcDriver', url);
Geoff Hayes
Geoff Hayes on 5 Feb 2015
Edited: Geoff Hayes on 5 Feb 2015
Viral - have you gone through the tutorial of http://www.mathworks.com/help/database/ug/microsoft-access-odbc-windows.html? It may provide some useful tips on how to set up your connection.
(Though I'm not sure why you are trying to connect to Excel which is a spreadsheet and not a database like MS Access.)

Sign in to comment.

Answers (0)

Categories

Asked:

on 4 Feb 2015

Edited:

on 5 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!