Open a .mdb file in Windows 7
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Risposte (0)
Vedere anche
Categorie
Scopri di più su Database Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!