Ace. OLE DB link string: Hdr=yes about Excel import; Imex=1

Source: Internet
Author: User
Tags ole first row microsoft access database

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)

Problems encountered when querying data in C # using Excel for tables

--------------------------------------------------------------------------------------------------------------- ------------------------------------------------

Encountered during Hdr=no

Exception information: At least one parameter is not assigned a value.
Exception object: Microsoft Access Database Engine

Speculate

Hdr=no is No field
Hdr=yes field, the column header of the 1th row in the default Excel table is the field name

If there is no, please state the following:

Causes the SQL statement to not read to the column value, Excel uses =char (column () +64) to get to the column named A,b,c .... However, the SQL statement also prompts that at least one parameter is not specified.

Schedule data to be read directly into the DataTable to continue with the next step, or add the default format of the Excel file data to a new file with fields.

Ace. OLE DB link string: Hdr=yes about Excel import; Imex=1

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.