EXCEL 连接字符串

 string strConn = "";
            if (extension == ".xlsx")
            {
                strConn = "Provider=Microsoft.Ace.OleDb.12.0;Data Source='" + excelPath + "';Extended Properties='Excel 12.0;IMEX=1'";          // 07+
            }
            else if (extension == ".xls")
            {
                strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + excelPath + "';Extended Properties='Excel 8.0;IMEX=1'";    //03
            }

 

posted @ 2013-06-13 08:24  mushishi  阅读(215)  评论(0编辑  收藏  举报