簡單的方法是透過ODBC來實現:具體實現一、 包含Excel檔案操作類標頭檔案#include "CSpreadSheet.h"二、 新建Excel檔案,並寫入預設資料// 新建Excel檔名及路徑,TestSheet為內部表名CSpreadSheet SS("c:\\Test.xls", "TestSheet");CStringArray sampleArray, testRow;SS.BeginTransaction();// 加入標題sampleArray.RemoveAll();sampleArray.Add("姓名");sampleArray.Add("年齡");SS.AddHeaders(sampleArray);// 加入資料CString strName[] = {"徐景周","徐志慧","郭徽","牛英俊","朱小鵬"};CString strAge[] = {"27","23","28","27","26"};for(int i = 0; i " + Rows.GetAt(j-1);}m_AccessList.AddString(strContents);}
簡單的方法是透過ODBC來實現:具體實現一、 包含Excel檔案操作類標頭檔案#include "CSpreadSheet.h"二、 新建Excel檔案,並寫入預設資料// 新建Excel檔名及路徑,TestSheet為內部表名CSpreadSheet SS("c:\\Test.xls", "TestSheet");CStringArray sampleArray, testRow;SS.BeginTransaction();// 加入標題sampleArray.RemoveAll();sampleArray.Add("姓名");sampleArray.Add("年齡");SS.AddHeaders(sampleArray);// 加入資料CString strName[] = {"徐景周","徐志慧","郭徽","牛英俊","朱小鵬"};CString strAge[] = {"27","23","28","27","26"};for(int i = 0; i " + Rows.GetAt(j-1);}m_AccessList.AddString(strContents);}