各個 版本 excel 連接 寫法 欄目 Microsoft Office 简体版
原文   原文鏈接

有頗有意思的網站:https://connectionstrings.com/ace-oledb-12-0/  很詳細得介紹了各類寫法ide

這裏主要提兩個:網站

string strCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + excelPath + "';Extended Properties='Excel 8.0;HDR=YES;IMEX=1'";
string strCon = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + excelPath + "';Extended Properties='Excel 8.0;IMEX=1'";

這兩個適用於97-03版本的excel,後綴.xlsspa

高版本的基本用下面的這個excel

 string strCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + excelPath + "';Extended Properties='Excel 12.0;HDR=YES;IMEX=1'";
相關文章
相關標籤/搜索
每日一句
    每一个你不满意的现在,都有一个你没有努力的曾经。
本站公眾號
   歡迎關注本站公眾號,獲取更多信息