(1) string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + m_strPath + ";Extended Properties=\"Excel 8.0;\";"; 
(2)string strConn = "Data Source=" + strDs + ";user id=" + strUser_id + ";password=" + strPass; 
这两种连接方法有深部不同??导致的结果用什么不同??第一种的Provider   Data Source  Extended Properties 都是什么意思??怎样写=号后面的代码??

解决方案 »

  1.   

    http://www.connectionstrings.com/
      

  2.   

    oledb连接  和odbc连接有什么不同??
      

  3.   

    前一种是 Excel 的 OLE DB 的连接串的写法:Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.  "IMEX=1;" tells the driver to always read "intermixed" (numbers, dates, strings etc) data columns as text. Note that this option might affect excel sheet write access negative.  http://www.connectionstrings.com/?carrier=excel
      

  4.   


    数据库的连接方式不同。
    继承层次结构
    System.Object
      System.MarshalByRefObject
        System.ComponentModel.Component
          System.Data.Common.DbConnection
            System.Data.Odbc.OdbcConnection
            System.Data.OleDb.OleDbConnection

            System.Data.SqlClient.SqlConnection
            System.Data.OracleClient.OracleConnection
      

  5.   

    OLE DB 比ODBC 效率高一点.如果你是ODBC FORM OLEDB的话,最终还是通过 ODBC 回到OLEDB 调用,白白绕了一圈ODBC 是老型的通用数据连接方案