Bonjour à tous,
C'est ma première participation ici , j'éspère trouver l'aide pour mon problème.
Je viens de développer une petite application et tout va bien sauf que je reçois ce méssage d'érreur à chaque fois que je clique sur mon bouton 'rechercher".
Pourtant je suis certain que les nom se correspondent.Citation:
Run time error "3256"
Impossible de trouver l'objet sur la collection correspondant au nom ou à la réference ordinale demandé.
Voici le code sur le bouton 'rechercher'.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Private Sub rechercher_Click() If Text1.Text <> "" Then If IsNumeric(Text1) = False Then Set DB = New ADODB.Connection Set RS = New ADODB.Recordset DB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database password=123; Data Source=" & App.Path & "\database.mdb" RS.Open "select * from table1 where nom like '%" & Text1.Text & "%' And prenom like '%" & Text2.Text & "%'", DB, adOpenStatic, adLockOptimistic If RS.RecordCount > 0 Then Text1.Text = RS!Nom Text2.Text = RS!Prenom Text3.Text = RS!age Text5.Text = RS!tel Text6.Text = RS!credit End If Text1.SetFocus End If End If End Sub
merci de votre aideCitation:
Private Sub Form_Load()
With Me.Adodc1
.ConnectionString = "F:\logicièl\Nouveau dossier (2)\database.mdb"
End With
On Error Resume Next
Set DB = New ADODB.Connection
Set RS = New ADODB.Recordset
DB.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database password=123; Data Source=" & App.Path & "\database.mdb"
End Sub