Column headings
By default,
it is assumed that the first row of your Excel data source contains columns
headings that can be used as field names. If this is not the case, you must
turn this setting off, or your first row of data "disappears" to be
used as field names. This is done by adding the optional HDR= setting to
the Extended Properties of the connection string. The default, which
does not need to be specified, is HDR=Yes. If you do not have column
headings, you need to specify HDR=No; the provider names your fields F1,
F2, etc. Because the Extended Properties string now contains multiple
values, it must be enclosed in double quotes itself, plus an additional pair of
double quotes to tell Visual Basic to treat the first set of quotes as literal
values
NOTE : Special characteristics can’t be accessed using ADODB
Connection with Excel.
deleting Excel data
You are more restricted in deleting Excel data than data
from a relational data source. In a relational database, "row" has no
meaning or existence apart from "record"; in an Excel worksheet, this
is not true. You can delete values in fields (cells).
However, you cannot:
- Delete an entire record at once or you receive the following error message:
Deleting data in a linked table is not supported by this
ISAM.
You can only delete a record by blanking out the contents of
each individual field.
- Delete the value in a cell containing an Excel formula or you receive the following error message:
Operation is not allowed in this context.
- You cannot delete the empty spreadsheet row(s) in which the deleted data was located, and your recordset will continue to display empty records corresponding to these empty rows.
A caution about editing Excel data with ADO: When you insert text data into Excel with ADO, the text value is
preceded with a single quote. This may cause problems later in working with the
new data.
Excel Limitations
The use of Excel as a data
source is bound by the internal limitations of Excel workbooks and worksheets.
These include, but are not limited to:
- Worksheet size: 65,536 rows by 256 columns
- Cell contents (text): 32,767 characters
- Sheets in a workbook: limited by available memory
- Names in a workbook: limited by available memory
Query Field Information
Every field (column) in an
Excel data source is one of the following datatypes:
- numeric (ADO datatype 5, adDouble)
- currency (ADO datatype 6, adCurrency)
- logical or boolean (ADO datatype 11, adBoolean)
- date (ADO datatype 7, adDate, using Jet; 135, adDBTimestamp, using ODBC)
- text (an ADO ad...Char type, such as 202, adVarChar, 200, adVarWChar or similar)
Source : support.microsoft.com
Comments