Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized views
Message
De
29/08/2001 21:30:53
 
 
À
29/08/2001 17:15:09
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00550577
Message ID:
00550675
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform