How do I use datainsert/fastinsert functions for an Access database?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
So I've been working on a project for awhile now and through the hiccups, I've finally gotten close to creating the script/function to do what I need. My problem now is that I can't seem to get those functions to work. Below is the command and the error I keep getting.
curs2 = fastinsert(conn,tablename,columns,tabledata);
Error using database.odbc.connection/fastinsert
Too many output arguments.
I've also tried datainsert, but I get the same thing. Anyways, conn is my connection, tablename is the name of the table in the Access database, columns is a cell of the column names in the database (that were extracted from an excel file (excelfile(1,1:end)), and tabledata is the data I wish to store in the Access database (also extracted from an excel file (excelfile(2:end,1:end)).
I've built this script to be used for similar data sets but with varying rows and/or columns. I would greatly appreciate any help as I can't seem to get this data to be easily inserted into the database I've made.
Thank you in advanced!
-L
댓글 수: 0
채택된 답변
Ankitha Kollegal Arjun
2017년 1월 13일
The error is likely due to the assignment of fastinsert to curs2. That is not a supported syntax. Instead, try the following to view the database:
fastinsert(conn,tablename,columns,tabledata);
curs = exec(conn,'select * from tablename');
curs = fetch(curs);
curs.Data
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!