本文主要是介绍c++利用ado操作excel(.xls)或(.xlsx)文件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
// ConnectionString = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=");
ConnectionString = _T("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=");
ConnectionString += "E:\\周报\\222.xlsx"; //excel file name
//ConnectionString += _T(";Extended Properties=\"Excel 8.0;HDR=YES;IMEX=0\"");
ConnectionString += _T(";Extended Properties=\"Excel 12.0 Xml\"");
BSTR resultsString = ConnectionString.AllocSysString();
pCon.CreateInstance(__uuidof(Connection));
pCon->Open(resultsString, "", "", NULL);
https://blog.csdn.net/kuoquan6492/article/details/84256037
这篇关于c++利用ado操作excel(.xls)或(.xlsx)文件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!