Home > Software engineering >  VS2010 of MFC achieved ACCESS database table export EXCEL file specified
VS2010 of MFC achieved ACCESS database table export EXCEL file specified

Time:09-20

Write under VS2010 MFC procedures, all kinds of data storage to ACCESS2010 inside database (. MDB) under different table, now wants to realize the database in the program under the specified in the table of export data into excel file, want to ask how to achieve this,
Before also found on BBS has encapsulated small program, but is not convenient to use directly,
The idea is can directly invoke the function of the database table was derived to EXCEL file, but I don't know how to call,
Hope to have the relevant code or wrapper classes, thank you very much,

CodePudding user response:

Export to CSV file, EXCEL can be read directly. The CSV file,

CodePudding user response:

reference 1/f, zhao teacher reply:
. Export to CSV file, EXCEL can be read directly. The CSV file.

But demand is want to a single table to generate the corresponding EXCEL file directly, because the EXCEL file also need and other software to read docking, implementation techniques have been used for

CodePudding user response:

See also: https://blog.csdn.net/worldy/article/details/54015613

CodePudding user response:

The
reference 3 floor worldy response:
see: https://blog.csdn.net/worldy/article/details/54015613

This is the content of reading EXCEL, has achieved, I want to put the database content output into EXCEL file, can only let program written line by line, feel that will be a little slow,

CodePudding user response:

To fast, you can write in the OLEDB interface
Insert Into [Excel; 8.0 HDR=YES; DATABASE=C \ : Path \ File XLS]. [Sheet1 $] Select * from XXXX
Refer to
https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/select-into-statement-microsoft-access-sql

But, Excel ODBC driver options some limitations, such as the number of columns cannot exceed 255, met such constraints, can only use COM to control an Excel process incoming data,
  • Related