Open a .mdb file in Windows 7
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!