Open a .mdb file in Windows 7

5 次查看(过去 30 天)
Haiko Rijkers
Haiko Rijkers 2011-8-17
I'm trying to open a .mdb file with Matlab without any toolbox.
Tho code 'm using is as follows:
cnstr='DRIVER={Microsoft Access Driver(*.mdb)};DBQ=G:\output2.mdb;';
cn = actxserver('ADODB.connection');
invoke(cn,'open', cnstr);
I Receive the error:
_??? Invoke Error, Dispatch Exception: Source: Microsoft OLE DB Provider for ODBC Drivers Description: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error in ==> oledbcn at 104_invoke(cn,'open', cnstr);_
I tried the same drivers and stuff in VBScript and there it worked fine. VBScript: Set MyConn = CreateObject("ADODB.Connection")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=G:\output2.mdb;"
SQL_query = "SELECT * from compnt;"
Set RS = MyConn.Execute(SQL_query)
WHILE NOT RS.EOF
wscript.echo(RS("Description"))
wscript.echo(RS("MBL"))
RS.MoveNext
WEND
RS.Close
set RS = nothing
MyConn.close
set MyConn = nothing
Does any one know what to do? Is it possible to read the database using VBScript and importing that to matlab. Or is there another way to do it in Matlab?
Note: the code worked fine in windows XP with a JET 4 driver
  1 个评论
Brian
Brian 2012-1-13
bump. i'd like to see how to do this too. Windows 7, 64-bit PC

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by