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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%' ****************************************************************************
' Manipulation de la base de données
'
' ****************************************************************************
' Déclarations des variables utilisées tout au long du script :
Dim Recordset1
Dim Recordset1_numRows
Dim MM_connexion_STRING
' chaine de connexion
MM_connexion_STRING = "Provider=SQLOLEDB;Server=srvatelier;Database=flofra;UID=sa;PWD=rpi"
' Connexion à la base :
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
'ouverture de la connexion
Recordset1.ActiveConnection = MM_connexion_STRING
'requete de selection de la table souhaitée
Recordset1.Source = "SELECT * FROM dbo.test"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_connexion_STRING
Recordset1.CursorType = adOpenDynamic
Recordset1.open "select * from dbo.test"
Recordset1_numRows = 0
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style2 {font-weight: bold; color: #660099; font-size: 24px;}
.Style3 {
font-size: 24;
font-weight: bold;
}
body {
background-color: #EEFEE9;
}
.Style4 {color: #CC0000}
.Style5 {font-family: "Comic Sans MS";
font-weight: bold;
}
a:link {
color: #336666;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
}
a:hover {
text-decoration: none;
color: #CC0000;
}
a:active {
text-decoration: underline;
}
-->
</style>
</head>
<body>
<p align="center" class="Style2">Page Web Dynamique Rapport</p>
<strong></strong>
<table border="1" align="center">
<tr>
<td><div align="center" class="Style3"><a>numhisto</a></div></td>
<td><div align="center" class="Style3"><a>nummach</a></div></td>
<td><div align="center" class="Style3"><a>numserie</a></div></td>
<td><div align="center" class="Style3"><a>nomNB</a></div></td>
<td><div align="center" class="Style3"><a>NomAV</a></div></td>
<td><div align="center" class="Style3"><a>dateSauv</a></div></td>
<td><div align="center" class="Style3"><a>nboctet</a></div></td>
<td><div align="center" class="Style3"><a>nomDD</a></div></td>
<td><div align="center" class="Style3"><a>nomVersion</a></div></td>
<td><div align="center" class="Style3"><a>dateMAJ</a></div></td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<tr>
<% for i = 0 to 9%>
<td>
<div align="center">
<%response.Write(Recordset1.Fields.Item(i).Value)%>
</div>
<%if i = 6 then
IF CInt(Recordset1.fields.item(i).value) > 200 THEN
response.write ("<font color='#FF0000'>" & Recordset1.Fields.Item(i).Value & "</font>")
ELSE
response.write (Recordset1.Fields.Item(i).Value)
END IF
end if %>
</td>
<%next%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<p><a href="essaipourTRI.asp?ch=nummach&tr=<%=tri%>"></a></p>
</table>
<p align="left"><a href="essaipourTRI.asp" target="_top">Haut de page</a></p>
<p align="center"><span class="Style5"><a href="menu.asp" target="_parent">revenir au menu principal</a></span></p>
</body>
</html>
<%
' fermeture et destruction de la connexion
Recordset1.Close()
Set Recordset1 = Nothing
%> |