zoukankan      html  css  js  c++  java
  • Excel 连接字符串详解

    Excel 连接字符串:
    1:  <add providerName="System.Data.OleDb" name="testExcel" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.xls;Extended Properties='Excel 8.0;HDR=false;IMEX=2;';Persist Security Info=False"/>
     
     

    参数HDR的值:
    HDR=Yes,这代表第一行是标题,不做为数据使用 ,如果用HDR=NO,则表示第一行不是标题,做为数据来使用。系统默认的是YES
    参数Excel 8.0
    对于Excel 97以上版本都用Excel 8.0
    IMEX ( IMport EXport mode )设置
    IMEX 有三种模式:
    0 is Export mode
    1 is Import mode
    2 is Linked mode (full update capabilities)
    我这里特别要说明的就是 IMEX 参数了,因为不同的模式代表著不同的读写行为:
    当 IMEX=0 时为“汇出模式”,这个模式开启的 Excel 档案只能用来做“写入”用途。
    当 IMEX=1 时为“汇入模式”,这个模式开启的 Excel 档案只能用来做“读取”用途。
    当 IMEX=2 时为“连結模式”,这个模式开启的 Excel 档案可同时支援“读取”与“写入”用途。
    意义如下:
    0 ---输出模式;
    1---输入模式;
    2----链接模式(完全更新能力)

  • 相关阅读:
    XMU1349 xmu_1349
    字符串排序
    linux磁盘文件与目录管理系统(2)
    poj 3667 Hotel
    poj 3468 A Simple Problem with Integers
    linux文与目录管理
    Linux的磁盘与文件管理系统(1)
    hdu 1698 Just a Hook
    poj3225 Help with Intervals
    poj 2886Who Gets the Most Candies?
  • 原文地址:https://www.cnblogs.com/netcasewqs/p/2626987.html
Copyright © 2011-2022 走看看