Bonjour,

je n'arriva pas à afficher dynamiquement mon tableau qui doit être constitué par un recordset. voici le code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sélection Impression Perso</title>
<style>
.tabcentr{
       text-align:left;
       width:100%;
}
.tabcentr th{
       text-align:center;
       padding:5px;
       font-size:11px;
       font-weight:bold;
       font-family:Arial;
       color:#FFFFFF;
       background-color:#2E2E2E;
}
.tabcentr tr:nth-child(even) {
       background-color: #F9F9F9;
}
.tabcentr td {
   color:#333333;
   font-weight:normal;
   font-family:Arial;
   font-size:12px;
   padding:5px;
   padding-left:10px;
   border-left: solid 1px #ccc; 
}
.tabcentr td a{
       color:#333333;
       text-decoration:underline;
}
.tabcentr td:first-child {
       border-left: none;
}
.tabcentr td a:hover
{
       color:#ed8600;
       text-decoration:underline;
}
.titrtab{
       color:#cd7600; 
       font-weight:bold;
}
</style>
</head>
<body style="font-family: Calibri" onload="Rechercher()">
    <!-- Fin du nouveau code --> 
    <script type="text/vbscript" language="vbscript">
        'Sub SelectImprim()
 
          ' If (selectionBareme.checked) Then
              ' window.External.DocLigne.InfoLibValeur(7) = selBareme.checked.value
              ' Window.External.DocLigne.ValidLigne()
              ' MsgBox("Impression ajoutée")
              ' window.close()
          ' End If
       ' end sub
 
        sub Rechercher()
            Dim varTableau
			Dim sCnx, oRst, sConstr, e, i
            varTableau = ""
		Set sCnx = CreateObject("ADODB.Connection")
        Set oRst = CreateObject("ADODB.Recordset")
        sConstr ="DSN=MONDSNr;UID=<Administrateur>;PWD=;"
 
        sCnx.connectionstring = sConstr
        sCnx.open
 
		oRst.Open "Select * From TRACE_ACHATS",sCnx
		varTableau = "<table>" 
		If Not oRst.EOF then
			oRst.MoveFirst
		While not oRst.EOF
 
			varTableau = varTableau & "<tr><td>"
            'varTableau = varTableau + "<input type='radio'" & checked & " name='selectionImpr' value='" & oRst("Impression_perso") & "' />"
			vartableau = vartableau & oRst("Impression_perso") &
            varTableau = varTableau & "</td></tr>"
			oRst.MoveNext
		Wend
		End If
 
        varTableau = varTableau & "</table>"
        document.getElementById("result").innerHTML = varTableau
 
        end sub
 
       </script>
 
    <table border="1" class="tabcentr" cellspacing="0" width="100%">
        <tr>
            <th valign="top" colspan="2" align="center"><strong>SELECTION DES IMPRESSIONS</strong> </th>
        </tr>    
    </table>
 
    <table border="1" class="tabcentr" cellspacing='0' width='100%'> 
        <tr>
 
               <th width='15%' valign='top' align='left'><strong>ImpressionPerso</strong></th>
        </tr>
    </table>
    <div id="result"></div>
 
</body>
</html>
A savoir que ma connexion marche bien. je l'ai testé dans un vbs. pourquoi mon tableau ne s'affiche pas ?
test sous Internet explorer ou firefox.

merci de votre aide.