【问题标题】:"Extended properties" component in the connection string连接字符串中的“扩展属性”组件
【发布时间】:2013-06-07 09:57:06
【问题描述】:

我的连接字符串Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<FILENAME>;Extended Properties=\"Excel 8.0;HDR=no;\"; 在我的电脑上工作,但在服务器上不工作。我认为这可能是因为 Excel/OLEDB 版本不同。你能告诉我吗:

  1. 如何确定提供程序以及需要安装什么。
  2. 如何确定扩展属性的正确值? 8.0 对应 Excel 版本吗?如果我只有 Excel 11 (2003),是 8.0?是否必须指定 Excel 版本?

【问题讨论】:

    标签: c# excel connection-string


    【解决方案1】:

    this link to help you determine the current release of jet.40 that is installed

    不妨试试:

    <%
      set conn=Server.CreateObject("ADODB.Connection")
      conn.Provider="Microsoft.Jet.OLEDB.4.0"
      conn.Open "c:/MyDB.mdb"
    
      response.write(conn.Provider)
    
      conn.close
    %>
    

    Excel 8.0 源数据库类型字符串用于指定 Microsoft Excel 8.0 和 9.0 工作簿,请参阅this msdn link for more info

    【讨论】:

    • 我的问题是由于 64 位与 32 位的问题。如果安装了 8.0 或更高版本的任何 Excel,Excel 8.0 似乎就可以了。
    • 我处理使用哪个提供程序的方式是基于文件名,即 .xls jet 4.0 for excel 8 很好,但使用 .xlsx 我使用 Provider=Microsoft.ACE.OLEDB.12.0 ;即excel 12.0
    猜你喜欢
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-21
    • 2016-03-02
    • 1970-01-01
    • 2022-01-05
    相关资源
    最近更新 更多