Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox - SQL
Message
 
À
19/04/2001 12:24:59
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00497353
Message ID:
00497398
Vues:
20

cmdSearch.Click()
LOCAL ARRAY laSQL[1]
LOCAL lcSearch

lcSearch = UPPER(THIS.PARENT.txtSearch.VALUE)
WITH THIS.PARENT.lstSearch
DO CASE
CASE .LISTINDEX = 1
SELECT * ;
FROM Org ;
WHERE lcSearch $ UPPER(orgno) ;
OR lcSearch $ UPPER(orgname) ;
INTO ARRAY laSQL
CASE .LISTINDEX = 2
SELECT * ;
FROM Person ;
WHERE lcSearch $ UPPER(name) ;
INTO ARRAY laSQL
CASE ...
ENDCASE
ENDWITH


That should get you started. One thing to keep in mind is that $ queries aren't rushmore optimizable - they will be slow with large record sets.

>VFP 6.0
>
>I have a 'search' form with a listbox. First, the user picks something from a Combobox with a list of what to search on (via, Org, Name, Person ID, Auth Type), then the code visible the labels/texts accordingly. Once the text(s) are filled in and the 'Find' button is clicked, I want to list the search on the listbox. The trick is I need to do different things as well with different tables.
>
>Lets say I want to do a search for Org $ 'Systems', I want to use the ORG table and list only two fields (org # and org name) with any wording included 'systems'.
>
>Lets say I want to do a search for Name $ 'Smith', I want to use the PERSON table and list only one field (name) with any wording included 'smith'.
>
>Etc...
>
>Now, the next thing is how to correspond back to the correct table (index, recno(), ??) and then I do whatever coding thereafter.
>
>The first thing that comes in my mind was to use SET FILTER TO but we know it's terrible slow. Anyone have ideas/suggestions to help me get started?
>
>Chuck
Brien R. Givens

Brampwood Systems
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform