Data Source
The second required key is
Data Source
. Its value is a
file system path that locates the
data source that is accessed through through the provider.
The following connection string refers to an Access database:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=P:\ath\to\access\db.accdb
The following connection string refers to a (macro-less, that is
*.xlsx
)
Excel worksheet. Note the necessary
Excel 12.0
right after the
Provider=…;
part.
The connection string also requires to specifiy if the data contains a header (HDR=Yes
):
Provider=Microsoft.ACE.OLEDB.12.0;Excel 12.0 Xml;Data Source=P:\ath\to\excel\worksheet.xlsx;HDR=Yes
TODO
IMEX
The extended attribute IMEX
(seen for a connection to Excel) stands for Import-Export Module and can probably be set to apparently be set to 0
, 1
or 2
.
As per
this website, setting IMEX to 1 tells the driver to read all («intermixed»?) columns as text.
This website also claims that setting IMEX to 0 forces TypeGuessRows=0.
When set to 1
or 2
, a Workbook cannot be created.