Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
>Hello,
>
>I am a VFP Programmer and have worked in 5.0 and 6.0
>Now I am doing project in Vb 6.0 In that I want to findout
>a particular record by using recordset.find function.
>It works with one field perfectly.
>But, problem arises that I want to find out a record by
>checking a track of two or it can be more than two fields
>also. At this time recordset.find gives an error like
>"Recordset conflict or Two long data type" etc . . .
>So, how can I find out a particular record by checking a
>track on more than one fields.
>Also, I am using an ADO technology and I am giving a
>command like following and I have created an Indexes also on
>those fields which I want to search.
>
>recordset.find "fieldname=" & "'" & & "'" _
> & " + fieldname=" & "'" & & "'"
>
>I know it is not possible but is there any other method to
>find out the records so that I can proceed further.
>
>Thanx in Advance,
>Amol
To add to the suggestions, you can use a filter and it will let you specify multiple criteria:
recordset.filter = "fieldname = 'something'" & _
& " and fieldname2 = 'something else'"
Then you scroll the rs and look for EOF condition. To clear the filter, use
recordset.filter = adFilterNone
I have not tried the filter in large recordsets but you wouldn't want to retrieve a large rs from the database either.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement