Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parametrized Queries
Message
De
17/11/1998 23:30:21
 
 
À
17/11/1998 18:16:08
Marcelo Codino
Mystic & Faith - Sistemas -
Buenos Aires, Argentine
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00158551
Message ID:
00158618
Vues:
11
>Can I create a parametrized query(ddateFrom-ddateTo) that drops their results in a ListBox or on another control ?
>
>Thanks in advance.

Yes.

You can do this in any of several ways. You can use straigh SQL, or a parameterized view defined in the database container.

A regular query would look like

ldBeginDate = {05/05/95}
ldEndDate = {07/07/1997}

SELECT Field1 ;
FROM myTable;
WHERE myTable.BeginDate = ldBeginDate;
AND myTable.EndDate = ldEndDate;
INTO CURSOR myCursor

THISFORM.EditBox1.RowSourceType = 1
THISFORM.EditBox1.RowSource = "myCursor"

With a view, you would define the view first with parameters in the WHERE clause
(WHERE EndDate = ?ldEndDate AND StartDate = ?ldStartDate)

Then, when you go to REQUERY the view, just fill the parameters and requery:

ldBeginDate = {05/05/95}
ldEndDate = {07/07/1997}

REQUERY('myView')

Grids, Listboxes and Comboboxes can all have cursors as their rowsource.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform