Recherche enregistrement base de données sous vb6

cs_rasedra Messages postés 6 Date d'inscription mardi 12 août 2008 Statut Membre Dernière intervention 25 janvier 2010 - 8 déc. 2009 à 05:39
ucfoutu Messages postés 18038 Date d'inscription lundi 7 décembre 2009 Statut Modérateur Dernière intervention 11 avril 2018 - 8 déc. 2009 à 08:28
Salut!
j'ai un problème avec mon application sous vb6(projet de données avec dataEnvironment).
supposons qu'on a Text1(0) à Text1(5) tous liés aux champs0 à champs5.
Je veux que quand on saisi un Numéro(Text1(0))dans Inputbox les informations correspondantes (text1(1) à text1(5) sont affichées aussi et dans flexgrid ligne séléctionnée.
et voilà mon code pour cette recherche d'un enregistrement.

Private Sub mnu_Rechercher_Click()
Dim findStr As String
If Not DataEnvironment1.rsCommand1.Supports(adFind) Then
MsgBox "Recordset doesn't support the FIND method"
Else
If DataEnvironment1.rsCommand1.Supports(adBookmark) Then
lastRow = DataEnvironment1.rsCommand1.Bookmark
End If
findStr = InputBox("N°Identification")
If findStr <> "" Then
DataEnvironment1.rsCommand1.MoveNext
DataEnvironment1.rsCommand1.Find "N°Identification'" & findStr & "'"
End If
If DataEnvironment1.rsCommand1.EOF Then
MsgBox "Could not find the company " & findStr
If DataEnvironment1.rsCommand1.Supports(adBookmark) Then
DataEnvironment1.rsCommand1.Bookmark = lastRow
End If
End If
End If
End Sub

l'erreur c'est:
'3001' les arguments sont de type incorrect, en dehors des limites autorisées.
Je suis totalement perdu, s'il vous plaît aidez moi c'est mon projet.
Merci à vous

2 réponses

cs_rasedra Messages postés 6 Date d'inscription mardi 12 août 2008 Statut Membre Dernière intervention 25 janvier 2010
8 déc. 2009 à 05:46
NB: c'est à la ligne
DataEnvironment1.rsCommand1.Find "N°Identification'" & findStr & "'" qui est séléctionnée à l'erreur.
0
ucfoutu Messages postés 18038 Date d'inscription lundi 7 décembre 2009 Statut Modérateur Dernière intervention 11 avril 2018 211
8 déc. 2009 à 08:28
Bonjour,
Qu'est "N°Identification" ? (ainsi écrit : une pure chaîne de caractères !)

Essaye

DataEnvironment1.rsCommand1.Find "[N°Identification]=" & findStr
0
Rejoignez-nous