%@ Language=JavaScript %>
<%
var pathToMDB = Server.MapPath("../../../kristiDB/kristi.mdb");
//alternating table colors:
var color1 = "#FFFFFF";
var color2 = "silver";
var curColor = color1;
//Holds the Database Connection Object
var adoCon = new ActiveXObject("ADODB.Connection");
var resultSet = new ActiveXObject("ADODB.Recordset");
var query = "SELECT * FROM tblKristiLogBook WHERE strModel like '%2A'";
//Set an active connection to the Connection object using a DSN-less connection
try
{
adoCon.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" + pathToMDB);
}
catch(e)
{
Response.Write("Error: I could not open a connection to the Access Database.
\nReason:" + e.description);
Response.End();
}
try
{
// Make the call:
resultSet.open(query, adoCon);
var out = "";
while(!resultSet.EOF)
{
var theKristi = new Object();
//gather the information for display:
theKristi.ID = new String( resultSet("internalKristiID"));
theKristi.serialnumber = new String( resultSet("strSerialNumber"));
theKristi.model = new String( resultSet("strModel"));
theKristi.builddate = new String( resultSet("strBuildDate"));
//clean up our data a bit:
for(field in theKristi)
{
if(theKristi[field] == "null")
theKristi[field] = "N/A";
}
//Build the HTML:
out += "
Serial Number |
Model |
Build Date |
---|---|---|