About Excel import Hdr=yes; Imex=1 detailed

Source: Internet
Author: User

Hdr=yes imported from Excel; Imex=1 detailed
December 27, 2011 Tuesday 11:17

Value of the parameter HDR:
Hdr=yes, this means that the first row is the title, not as data use, if used Hdr=no, then the first row is not the title, as data to use. The system default is Yes
Parameter Excel 8.0
For Excel 97 or later, use Excel 8.0
IMEX (IMport EXport mode) settings
There are three modes of IMEX:
0 is Export mode
1 is Import mode
2 is Linked mode (full update capabilities)
What I want to highlight here is the IMEX parameter, because different patterns represent different reading and writing behaviors:
When imex=0 is "Export mode", the Excel file opened by this mode can only be used for "write" purposes.
When Imex=1 is "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 meanings are as follows:
0---output mode;
1---input mode;
2----link mode (full update capability)

The following content is for my own search and editing, belonging to a personal work.
String connstr = "provider=microsoft.ace.oledb.12.0; Persist Security info=false;data source= "+ @Excfilename +"; Extended Properties=excel 8.0; Hdr=yes;imex=2 ";
In this case, the "installable ISAM could not be found" may appear.
The most important reason for this problem is that there are fewer elements in our statement.

String connstr = "provider=microsoft.ace.oledb.12.0; Persist Security info=false;data source= "+ @Excfilename +"; Extended properties= ' Excel 8.0; Hdr=yes;imex=2 ' ";

String connstr = "provider=microsoft.ace.oledb.12.0; Persist Security info=false;data source= "+ @Excfilename +"; Extended properties=/"Excel 8.0; hdr=yes;imex=2/"";

Both of these cases can be resolved.

Hdr=yes about Excel import; Imex=1 detailed

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.