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 84 85 86 87 88 89 90 91 92 93 94 95 96
|
'Connexion à la BD
Call connect
'Déclaration des titres et de la taille du flexgrid msfimputation
titre = Array("NumValeur", "Propriété", "Valeur Patient", "Valeur Normale", "Interprétation", "NumExam", "Examen", "NumPropriété", "NumPatient", "Date Dossier")
taille = Array(1000, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500)
For i = 0 To 9
msfdossier.ColWidth(i) = taille(i)
msfdossier.TextMatrix(0, i) = titre(i)
Next
Dim rscount As New ADODB.Recordset
Dim nbmaxlignes As Integer
rscount.Open "select count(numpropriete) as nblignes from Tablevaleur where numdossier = " & txtnumdossier & " ", cn, adOpenStatic, adLockPessimistic ' , adOpenDynamic, adLockOptimistic
nbmaxlignes = (rscount!nblignes)
'Déclaration du recordset rs contenant l'ensemble de la table tablechauffeur trié par nom
Set rs = New ADODB.Recordset
rs.Open "select * from TableValeur where numdossier = " & txtnumdossier & " ", cn, adOpenDynamic, adLockOptimistic
Dim rspropriete As New Recordset
Dim rsexamen As New Recordset
Dim rsdossier As New Recordset
i = 1
While (Not rs.EOF)
If Not IsNull(rs) Then
rspropriete.Open "select tablepropriete.nompropriete, tablepropriete.numpropriete from tablevaleur, tablepropriete where tablevaleur.numpropriete = tablepropriete.numpropriete and tablevaleur.numdossier = " & rs(5) & "", cn, adOpenDynamic, adLockOptimistic
rsexamen.Open "select tableexamen.numexamen, tableexamen.nomexamen from tabledossier, tableexamen where tabledossier.numexamen = tableexamen.numexamen and numdossier = " & txtnumdossier & "", cn, adOpenDynamic, adLockOptimistic
rsdossier.Open "select numpatient, datedossier from tabledossier where numdossier = " & txtnumdossier & "", cn, adOpenDynamic, adLockOptimistic
msfdossier.Rows = nbmaxlignes + 1
msfdossier.TextMatrix(i, 0) = rs(0)
msfdossier.TextMatrix(i, 1) = rspropriete(0)
msfdossier.TextMatrix(i, 2) = rs(1)
msfdossier.TextMatrix(i, 3) = rs(2)
msfdossier.TextMatrix(i, 4) = rs(3)
msfdossier.TextMatrix(i, 5) = rsexamen(0)
msfdossier.TextMatrix(i, 6) = rsexamen(1)
msfdossier.TextMatrix(i, 7) = rspropriete(1)
msfdossier.TextMatrix(i, 8) = rsdossier(0)
msfdossier.TextMatrix(i, 9) = rsdossier(1)
End If
i = i + 1
rs.MoveNext
rsexamen.MoveNext
rsdossier.MoveNext
rspropriete.MoveNext
rspropriete.Close
rsexamen.Close
rsdossier.Close
Set rspropriete = Nothing
Set rsexamen = Nothing
Set rsdossier = Nothing
Wend
msfdossier.Refresh
rs.Close
Set rs = Nothing
msfdossier_Click |
Partager