>Let's say I want to create a view with two parameters: state and gender.
>So I can pull a query for given state or for given gender or both.
>How can I get a query In VB if one parameter is blank (not suuplied meaning everything). If I leave it as an empty string then I get empty query. (I know that it works in Foxpro with empty string)
>Please help.
It depends a little on your target database. Assuming that you are using Access, a LIKE clause in your SELECT statement should work like so:
SELECT * FROM myTable WHERE myField LIKE '*';
Your parameter will have to be constructed like so:
myVar = myUserValue & "*"
So that if
myUserValue is empty the query will still return rows, all in such case. This would work in VFP too, if instead of the asterisk you add a
% instead.
HTH