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