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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| Dim conna As New ADODB.Connection
Dim sqla1 As New ADODB.Command
Dim orsa1 As New ADODB.Recordset
Dim sqla2 As New ADODB.Command
Dim orsa2 As New ADODB.Recordset
Dim Nb_item 'nombre d'item dans le listview
Dim pos_car As Integer 'Position Classement carrière
Dim pos_pro As Integer 'Position au classement pro
Dim gain_car As Integer 'Gain au classement carrière
Dim gain_pro As Integer 'Gain au classement pro
lien_BDD = GetSetting("Gestion Team 2016", "Dossier", "Lien Dossier", "0")
lien_BDD = lien_BDD & "\Donnees\Donnees_WRC.mdb"
'Modifie ligne par ligne le listview
'Try
' OUVERTURE DE LA BDD DE L'EPREUVE
conna.Provider = "Microsoft.Jet.OLEDB.4.0"
conna.ConnectionString = lien_BDD
conna.Open()
Nb_item = Liste_export_WRC.List_export_pilote_wrc_rallye.Items.Count
If Nb_item = "0" Then
'Pas de classement sur le listview
Exit Sub
End If
For i = 0 To Nb_item - 1
'recup le gain en classement carrière
pos_car = Liste_export_WRC.List_export_pilote_wrc_rallye.Items(i).SubItems(11).Text
sqla1.ActiveConnection = conna
sqla1.CommandText = "SELECT * FROM Dotation_Pilote_Carierre WHERE Position=" & pos_car
orsa1.Open(sqla1)
If IsDBNull(orsa1("Valeur").Value) Then
gain_car = "0"
Else
gain_car = orsa1("Valeur").Value
End If
Liste_export_WRC.List_export_pilote_wrc_rallye.Items(i).SubItems(12).Text = gain_car
orsa1.Close()
MsgBox(i)
'----------------------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------------------
'----------------------------------------------------------------------------------------------------
'recup le gain en classement pro
pos_pro = Liste_export_WRC.List_export_pilote_wrc_rallye.Items(i).SubItems(13).Text
sqla2.ActiveConnection = conna
sqla2.CommandText = "SELECT * FROM Dotation_Pilote_Pro WHERE Position=" & pos_pro
orsa2.Open(sqla2)
If IsDBNull(orsa2("Valeur").Value) Then
gain_pro = "0"
Else
gain_pro = orsa2("Valeur").Value
End If
Liste_export_WRC.List_export_pilote_wrc_rallye.Items(i).SubItems(14).Text = gain_pro
orsa2.Close()
Next i
orsa1 = Nothing
sqla1 = Nothing
orsa2 = Nothing
sqla2 = Nothing
'fermer la BDD
conna.Close()
conna = Nothing
'Catch ex As Exception
' MsgBox(ex.Message, MsgBoxStyle.Information, "Erreur Lecture table dotation Pilote Carrière et Pro WRC")
'End Try |