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
| Function test() as Boolean
Dim db As DAO.Database
Dim RS As DAO.Recordset
Dim strSQL as String
Dim j as Integer
Dim result As Boolean
result = False
On error goto fin
Set db = OpenDatabase("C:\path_de_la_base\base.mdb", False)
strSQL = "SELECT ID_Biologie, date_biologie, heure_biologie, leucocytes, hb, plaquettes FROM T_Biologie ORDER BY ID_Biologie;"
Set RS = db.OpenRecordSet(strSQL)
j=2
Do Until RS.EOF
Cells(1,j).Value = RS!ID_Biologie
Cells(2,j).Value = RS!Date_Biologie
Cells(3,j).Value = RS!Heure_Biologie
Cells(4,j).Value = RS!Leucocytes
Cells(5,j).Value = RS!HB
Cells(6,j).Value = RS!Plaquettes
j = j+1
RS.MoveNext
Loop
db.Close
test = True
Exit Function
fin:
test = False
End Function |
Partager