<html>
<head>
<title>Assets</title>
</head>
<body bgcolor="white" text="black">
<table cellspacing="0" cellpadding="0" border="1" width="100%">
<tr>
<th align="center" width="150" bgcolor="gray"><b><u>DEVICE TYPE</U></B></th>
<th align="center" width="100" bgcolor="gray"><b><u>MODEL #</U></B></th>
<th align="center" width="150" bgcolor="gray"><b><u>SERIAL #</U></B></th>
<th align="center" width="150" bgcolor="gray"><b><u>DEPARTMENT</U></B></th>
<th align="center" width="150" bgcolor="gray"><b><u>USER</U></B></tdh>
<th align="center" width="110" bgcolor="gray"><b><u>CONDITION</U></B></th>
<th align="center" width="250" bgcolor="gray"><b><u>NOTES</U></B></th></TR>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAsset 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("assets.mdb")
'Create an ADO recordset object
Set rsAsset = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database DESCending order
strSQL = "SELECT assets.DeviceType, assets.Model, assets.Serial, assets.Department, assets.User, assets.Condition, assets.Notes FROM assets ORDER BY assets.ID_no DESC;"
'Open the recordset with the SQL query
rsAsset.Open strSQL, adoCon
%>
<%
'Loop through the recordset
Do While not rsAsset.EOF
'Write the HTML to display the current record in the recordset
Response.Write ("<tr>")
Response.Write ("<td>")
Response.Write (rsAsset("DeviceType"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("Model"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("Serial"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("Department"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("User"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("Condition"))
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (rsAsset("Notes"))
Response.Write ("</td>")
Response.Write ("</tr>")
'Move to the next record in the recordset
rsAsset.MoveNext
Loop
'Reset server objects
rsAsset.Close
Set rsAsset = Nothing
Set adoCon = Nothing
%>
</table>
</body>
</html>