Bonjour,
Je bosse sous VB6
voici un bout de code qui ne m'emmene nul part :
Private Sub Form_Activate()
Set adherent = New ADODB.Recordset
' creer sa structure (champ)
adherent.Fields.Append "num_adherent", adInteger
' ajouter un champ adherent
adherent.Fields.Append "Civilite", adBSTR, 14
adherent.Fields.Append "nom", adBSTR, 14
adherent.Fields.Append "prenom", adBSTR, 50
adherent.Fields.Append "Adresse1", adBSTR, 50
adherent.Fields.Append "CP", adInteger, 14
adherent.Fields.Append "Ville", adBSTR, 50
' objet grille de donnees
adherent.Open
Set grille.DataSource = adherent
grille.AllowAddNew = True
grille.AllowDelete = True
je ne veux pas de Datagrid pour le retour des infos à recuperer. comment connecter à la base sans passer par adodc1 ? sachant que j'aurai plusieurs (3) types de tables adherent à distinguer
j'ai essayé ce code aussi et il bloque sur la table adherent. car je ne vois pas comment la connecter à mon programme. normal alors qu'il bloque, mais comment m'y prendre ?
Private Sub Recherche_Click()
Dim num_adherent As Integer
Dim i As Integer
InputBox ("numero adherent")
i = 0: trouvé = False
' lire (num_adherent.adherent)
While (i < UBound(adherent)) And Not trouvé
If num_adherent = adherent(i).num_adherent Then
Else
i = i + 1
End If
Wend
num_adherent = trouvé
End Sub
merci de ta lumiere
J'ai un neuronne de plus ce jour - merci