Null values in parameterized queries

I have a problem with parameterized queries.  Assume you have a query on
some table,
for example the customer.db demonstartion table that ships with Delphi.

Now assume you want the query to return all the customer numbers for
people who live in Hawaii.  Say your query is like the one below, with
:State being a parameter.

SELECT DISTINCT CustNo, State
FROM ":DBDEMOS:Customer.db"
WHERE
(State = :State)
ORDER BY CustNo, Stat

If you set the state to a non null value, like "HI" then everything
works fine.  But if you set the value of :State to null (either using
the parameters editor accessed in design time through the TQuery object
or programatically at runtime) the result set contains no records,
although it should.

Is this a bug or is there something I am missing?  If you search through
the BDE API reference and the Delphi code (in dbtables.pas) everything
seems to be passed correctly to the BDE.

I used  the above example because it illustrates my problem.  In
actuality, my problem is more complicated because it deals with linking
multiple TQueries together using the dataSource property.
Unfortunately, in some case, some of  linking fields in the queries can
be blank, and thus the child queries will return empty result sets when
they should not.  The only solution I can see is dynamically changing
the query to include or not include the parameter, but that would be a
huge pain.

Any help would be greatly appreciated.

Charlie Savage
c...@interserv.com