Open a .mdb file in Windows 7

1 visualización (últimos 30 días)
Haiko Rijkers
Haiko Rijkers el 17 de Ag. de 2011
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 comentario
Brian
Brian el 13 de En. de 2012
bump. i'd like to see how to do this too. Windows 7, 64-bit PC

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by