Error Accessing MS Access Database in Script Run from Command Prompt
Ältere Kommentare anzeigen
I created a User Data Source named Reduction in the ODBC Source Administrator using a Microsoft Access Driver (*.mdb, *.accdb) for a MS Access Database. Interactively in Matlab, I can successfully run the following without error:
conn = database('Reduction','','');
setdbprefs('DataReturnFormat','cellarray');
disp(qry);
rslts = fetch(conn,qry);
However, when I run a script containing those commands using the following at acommand prompt:
matlab -nodesktop -nosplash -r "run O:\run_spectra_plot_by_ms_access.m"
I get the error
??? Error using ==> database.fetch at 23
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application Please verify
that login information and database url are valid.
Error in ==> run_spectra_plot_by_ms_access at 7
rslts = fetch(conn,qry);
Why am I getting that error and how can I resolve it?
3 Kommentare
Walter Roberson
am 7 Apr. 2016
Could you verify that the version of MATLAB that you are getting when you run interactively is the same one that you get when you invoke matlab from the command line?
Antworten (0)
Kategorien
Mehr zu Configure Environment finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!