how to connect dataset in matlab?

9 ビュー (過去 30 日間)
Waqas
Waqas 2014 年 8 月 29 日
回答済み: Friedrich 2014 年 8 月 29 日
when executing the code given below i am getting the following error:
cannot connect database [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
Here is the code:
conn = database('con', '', '');
if(isempty(conn.message))
disp('Database connected')
else
disp('cannot connect database')
disp(conn.message)
return; %stop running
end
sqlquery = 'select * from cust';
decA = exec(conn, sqlquery);
decA = fetch(decA);

採用された回答

Friedrich
Friedrich 2014 年 8 月 29 日
Hi,
this indicates a bittedness missmatch between MATLAB and your ODBC driver. I guess you use a 64bit MATLAB but have a 32bit ODBC driver installer. Either use a 32bit MATLAB or install a 64bit ODBC driver and use the native "database.ODBCConnection" connection (new feature since 14a).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by