How do I use datainsert/fastinsert functions for an Access database?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
L
am 10 Jan. 2017
Kommentiert: L
am 27 Jan. 2017
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 Kommentare
Akzeptierte Antwort
Ankitha Kollegal Arjun
am 13 Jan. 2017
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
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Database Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!