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 个评论

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);
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.)

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by