How to test for empty Excel cell in SELECT ... WHERE



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


.



Relevant Pages


Quantcast