Colum name as a query parameter


2004-08-05 06:19:01 PM
delphi68
Is it possible to pass a column name as a ADOquery parameter? Something like
SELECT * FROM tablename
WHERE :somecolumn IS NULL
It does not seem to work on Jet 4.0 OLE DB provider, no errors just no
records.
I want a parameterised query to do a wildcard search. Of course LIKE '%'
only returns any value but does include records with null in that column. I
can't see a way to optionally include "column IS NULL" when the search
string is anything, but not include it otherwise. Is two queries the only
solution?
Dave