how to load data from excel into C++ Application
Can someone tell me how I can do the following or point me into the right direction, thanks in advance:
I am trying to load data from an excel file into a grid/listview control in a Visual C++ 6.0 MFC exe application. The user should be able to edit the data and have the changes reflected in the excel file. However if possible, I do not want it to be necessary for user to have excel on their machine, b/c of this I want ot avoid OLE. I would also like to know what controls are best to display the excel data and/or what are the options.
A link to a tutorial will be great, I've tried looking but all I find is tutorials for VB.
You will need to have some way to access the excel spreadsheet, ODBC, DSN, DSN-less connection. From that point you will be able to `import` the excel data.
Will the data entry point be excel? If not, you may consider exporting the excel spreadsheet to a csv or some other delimited file.
Thanks for the advice.
I am using odbc connection right now and my eventual goal is to have a data loaded from an excel spreadsheet into a listview/datagrid control. I want to be able to edit/delete/add data and have it reflected back in the excel spreadsheet. At the same time I want be able to change whole columns in the display control by loading data from an entirely different database(not necessarliy excel) afterwhich the changes would reflect in the excel file.
Do you know if this is possible and if so, what is the best control and data connection to use (lisview or MS data grid; dao, odbc, ole?)
I am not a proponet for using MS Excel as a front end. Are there any issues with using MS Access, MySQL, Firebird or someother database management system?
July 10th, 2003, 06:50 AM
All of my data is in excel sheets, also the future users of the system would want continue storing their data in excel spreadsheets.
Why are you against excel?
July 10th, 2003, 08:08 AM
No I am not against Excel. As with everything, MS Excel is valuable. In using MS Excel to store data you could possibility encounter row limitations, lock contentions, enability to audit and secure data access, perform consistent backups or be able to restore to point in time and if the file becomes `too dense`, it may no longer function properly or be accessible. If this is production data taking preventive steps early on could save you a lot of time later.