Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find with complex criteria
Message
 
À
26/01/2001 06:57:23
Peter Walburn
Omega Data Services Ltd
Aberdeen, Royaume Uni
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00468960
Message ID:
00468979
Vues:
16
>Hello,
>
>I am using ADO in my VB project. I have the need to do a find on a recordset, but I need to do this on more than one field. So my criteria is something like: "Field1='X' And Field2='Y'".
>The Find method fails on this as it uses more than one field. Is there a simple way to get around this?

You can't have more than 1 field in the find as you discovered. Some workarounds to it are:

-Use the Filter and then the Find (this can be really slow if you have a big recordset).
-Requery the database having your 2 fields in the Where clause.
-Concatenate your 2 fields as one when you first query the database and use the find on this new field.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform