Bonjour à tous,

je ne parviens pas mettre à jour mon recordset :

Voici la connexion :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
        'demande de connexion
        cn = New ADODB.Connection
        cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=ACCESSMATIC.ACCDB"
        cn.Open()
L'ouverture du Recorset :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
                ' Update de la table RChevaux
                MyString = "select * from Chevaux where NumGeny='" & RReunions.Fields("NumGeny").Value & "' and NumCourse=" & RCourses.Fields("NumCourse").Value & " order by ClaCRIFX asc"
                RChevaux = New ADODB.Recordset
                With RChevaux
                    .CursorType = ADODB.CursorTypeEnum.adOpenStatic
                    .LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
                    .CursorLocation = ADODB.CursorLocationEnum.adUseClient
                    .Open(MyString, cn, , , ADODB.CommandTypeEnum.adCmdText)
                End With
                RChevaux.MoveFirst()
La tentative de mise à jour :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
                    If RChevaux.Fields("PtsStats").Value < PtsStats Then
                        RChevaux.Fields("PtsStats").Value = PtsStats
                    End If
                    If RChevaux.Fields("ValStats").Value < ValStats Then
                        RChevaux.Fields("ValStats").Value = ValStats
                    End If
                    RChevaux.Update()
                    RChevaux.MoveNext()
Voyez-vous où j'ai fait une erreur ?

D'avance merci, Tchicken