Export Data to Ms Access - HELP!!
이전 댓글 표시
Hello!!
I have tried many ways/tutorials on how to export data from MATLAB to Ms Access, but so far, I haven't fully succeed. I could export all my dataset into 1 column instead of 1 row.
Could you guys please help me??
Thanks in advance.
Here's my code:
colnames - cell array with Column Names <1 x 44>
data - cell array with data set to export to Ms Access <15 x 44>
handles.DB.con - Database connection object.;
datainsert(handles.DB.con,'databaseTable', colnames, data);
error:
Error using database/datainsert (line 104)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
댓글 수: 5
Walter Roberson
2013년 10월 14일
Complete speculation: perhaps handles.DB.con is not a valid connection at that time. Perhaps it is [] the empty array; perhaps the connection has not been appropriately opened after it was configured.
Friedrich
2013년 10월 14일
@Walter: thats unlikely. In that case you would get an error telling you undefined function datainsert for input or type struct.
The error comes from the driver directly. Are you sure all those columns exist in your database? AFAIK the insert function gives a better error message. Maybe try insert to see if you get a better error.
BSantos
2013년 10월 14일
Friedrich
2013년 10월 14일
I assume it's related to a column name. Maybe one contains a reserved word. Can you post all the columnnames here? The easiest would be
celldisp(colnames)
BSantos
2013년 10월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!