How to test for empty Excel cell in SELECT ... WHERE
- From: "Sven Pran" <no.direct@xxxxxxxxxxx>
- Date: Sun, 24 Feb 2008 21:13:55 +0100
I am doing some trials with ADO connecting to MS Excel
along the lines suggested in
http://delphi.about.com/od/database/l/aa090903a.htm
I have run into a problem when trying to SELECT only rows where
the cell in a particular column is empty (or is not empty)
The error message I receive is: "Data type mismatch in criteria expression"
and the criteria I have tried include: '' ' ', "", " " (single or double
quote pairs
with nothing or one space between them).
The cell in question contains numbers and my statements like:
SELECT ... WHERE cellname = 1611
work as expected.
How can I specify empty (or not empty) cells in my WHERE clause?
In case it matters the connection string is:
AdoConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;' +
'Data Source=' + OpenDialog1.FileName + ';' +
'Extended Properties=Excel 8.0;';
By the way, is there a reference manual available on the internet for SQL
statements with Microsoft.Jet.OLEDB.4.0 ?
grateful for any suggestions
regards Sven
.
- Follow-Ups:
- Re: How to test for empty Excel cell in SELECT ... WHERE
- From: Chris.Cheney
- Re: How to test for empty Excel cell in SELECT ... WHERE
- Prev by Date: Re: OLE DB Provider not found for SQL Compact edition even after installing
- Next by Date: Re: How to test for empty Excel cell in SELECT ... WHERE
- Previous by thread: ACCESS with SQL server syntax
- Next by thread: Re: How to test for empty Excel cell in SELECT ... WHERE
- Index(es):
Relevant Pages
|