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
|
<%
'--- Ouverture de la connexion
'--- Ici le fichier asp se trouve dans le même répertoire que test.xls
Set Conn = Server.CreateObject("ADODB.Connection")
str = "Driver={Microsoft Excel Driver (*.xls)}; DBQ=" & Server.MapPath(".") &"\test.xls"
Conn.Open str
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "SELECT * FROM test WHERE taches <> NULL;"
rs1.Open sql1, Conn
rs1.movefirst
response.write "<table class='table'><tr class='tr'><th class='th'>tache</th>"
response.write "<th class='th'>action</th>"
response.write "<th class='th'>truc</th>"
response.write "<th class='th'>Avancement</th></tr>"
'une boucle pour tout afficher
do while rs1.EOF
response.write "<tr class='tr'><td class='td'>" & rs1("taches") & "</td>"
response.write "<td class='td'>" & rs1("action") & "</td>"
response.write "<td class='td'>" & rs1("truc") & "</td>"
response.write "<td class='td'>" & rs1("avancement") & "</td></tr>"
rs1.movenext ' à ne pas oublier sinon boucle infinie
loop
response.write "</table>"
rs1.close
set rs1=nothing
conn.close
set conn=nothing
%> |
Partager