1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| On Error GoTo erreur
Dim cnn As ADODB.Connection
Dim rcs As ADODB.Recordset
Dim req As String
Set cnn = CurrentProject.Connection
Set rcs = New ADODB.Recordset
req = "SELECT VIDEO.NUM_VIDEO, VIDEO.NUM_SUPPORT, VIDEO.NUM_GENRE, VIDEO.NUM_PROPRIETAIRE, VIDEO.TITRE_VIDEO, REALISER.NUM_REALISATEUR, "
req = req + " REALISER.ANNEE_REALISATION, VIDEO.DUREE_VIDEO, VIDEO.DESCRIPTION_VIDEO, VIDEO.COMMENTAIRE_VIDEO, VIDEO.JAQUETTE_VIDEO, VIDEO.NOTE_MOYENNE_VIDEO "
req = req + "FROM VIDEO, REALISER "
req = req + "WHERE VIDEO.NUM_VIDEO="
req = req + Me.txtRechercheTitre.Column(0) + " "
req = req + "AND REALISER.NUM_VIDEO=VIDEO.NUM_VIDEO;"
MsgBox req
rcs.Open req, cnn, adOpenDynamic, adLockOptimistic
If Not rcs.EOF Then
rcs.MoveFirst
End If
Do While Not rcs.EOF
MsgBox rcs.Fields("NUM_VIDEO")
txtNumVideo = rcs.Fields("NUM_VIDEO")
txtNumSupport = rcs.Fields("NUM_SUPPORT")
txtNumGenre = rcs.Fields("NUM_GENRE")
txtNumProprietaire = rcs.Fields("NUM_PROPRIETAIRE")
txtTitreVideo = rcs.Fields("TITRE_VIDEO")
txtNumRealisateur = rcs.Fields("NUM_REALISATEUR")
txtAnneeRealisation = rcs.Fields("ANNEE_REALISATION")
txtDureeVideo = rcs.Fields("DUREE_VIDEO")
txtDescriptionVideo = rcs.Fields("DESCRIPTION_VIDEO")
txtCommentaireVideo = rcs.Fields("COMMENTAIRE_VIDEO")
txtJaquetteVideo = rcs.Fields("JAQUETTE_VIDEO")
txtNoteMoyenneVideo = rcs.Fields("NOTE_MOYENNE_VIDEO")
txtJaquetteVideo_LostFocus ' pour afficher la jaquette
rcs.MoveNext
Loop
rcs.Close
cnn.Close
Exit Sub
erreur:
MsgBox "erreur " & Err.Number & " : " & Err.Description, vbCritical
Exit Sub
End Sub |
Partager