An explanation of the HDR and IMEX parameters in the Excel connection string _ Application Tips

Source: Internet
Author: User
Tags first row

Value of the parameter HDR:
Hdr=yes, this means that the first row is the title, not for data use, if you use hdr=no, it means that the first row is not a title, as data to use.

The system defaults to Yes
Parameter Excel 8.0
Excel 8.0 for all versions of Excel 97

IMEX (IMport EXport mode) Setup

There are three modes of IMEX:

Copy Code code as follows:

0 is Export mode
1 is Import mode
2 is linked mode (full update capabilities)

What I specifically want to illustrate here is the IMEX parameter, because different patterns represent different reading and writing behaviors:
Copy Code code as follows:
When imex=0 is "outbound mode", the Excel file opened in this mode can only be used for "write" purposes.
When Imex=1 is an "import Mode", the Excel file opened in this mode can only be used for "read" purposes.
When imex=2 is "connected mode", the Excel file opened in this mode can support both read and write purposes.

The meaning is as follows:

Copy Code code as follows:

0-Output mode;
1-Input mode;
2--link mode (full update capability)

Copy Code code as follows:

ConnStr = "provider=microsoft.ace.oledb.12.0;
Persist security Info=false;data source= "&database&";
Extended Properties=excel 8.0; Hdr=yes;imex=2 ";

In this case, it is possible that "no installable ISAM can be found."
The most important reason for this problem is that there are fewer elements in our statement.

Copy Code code as follows:

ConnStr = "provider=microsoft.ace.oledb.12.0;
Persist security Info=false;data source= "&database&";
Extended properties= ' Excel 8.0; Hdr=yes;imex=2 ' ";

Copy Code code as follows:

ConnStr = "provider=microsoft.ace.oledb.12.0;
Persist security Info=false;data source= "&database&";
Extended properties=/"Excel 8.0; hdr=yes;imex=2/"";

Both of these situations can be resolved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.