Open a .mdb file in Windows 7

조회 수: 1 (최근 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