Sub Date_de_Naissance()
Dim RECSET As New ADODB.Recordset, numero_de_police
With Sheets("Coûts").Range("A1").CurrentRegion
Call CONNEXION_PE("xxx", "xxx", "xxx")
For I = 2 To .Rows.Count
numero= .Cells(I, "A").Value
If Len(numero) > 0 Then
RECSET.Open " select pers.D_NAISSANCE as D_NAISSANCE from dossier sousc,contractant cntr, personne pers" & _
" where sousc.no_police = '" & numero & "'" & _
" and sousc.is_contractant = cntr.is_ctant_pere and pers.is_personne=cntr.is_personne", cnn_Pe, adOpenDynamic, adLockBatchOptimistic
If Not RECSET.EOF Then
.Cells(I, "C").Value = RECSET.Fields("D_NAISSANCE").Value
Else
.Cells(I, "C").Value.Value = "Inconnu"
End If
RECSET.Close
End If
Next
End With
Call DECONNEXION_PE
End Sub