Cool
A connection is made to an Access db just like you would do for any other ODBC connection. The server we're using is a 1.4 Ghz P3 Dell, so it doesn't seem to get bogged down too often ;-).
If you are interested, this is the code to the asp script requested by the Flash intro to get the latest news:
PHP Code:
var months = new Array ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
var monthValue = new Array (13,14,15,16,17,18,19,20,21,22,23,24);
var now = new Date();
var month = now.getMonth();
var date = now.getDate();
var day = now.getDay();
var year = now.getYear();
var week = 1;
if (year < 2000) year = year + 1900;
var monarr = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monarr[1] = 29;
sday = day;
while (date != 0){
date --;
sday --;
if (sday < 0){
sday = sday + 7;
week ++;
}
}
var currentMonth = months[month]
var currentWeek = week
var current_category = monthValue[month]
var out
sql = "SELECT * FROM data where data_category = " + current_category + " order by data_subcategory, data_name";
rs = Server.CreateObject("ADODB.RecordSet");
rs.Open (sql, Conn, 2,3);
if (rs.EOF){ // check to see if rs is empty
out += (' <button name="No articles">\n')
out += (' <info>There are no new events for this week.</info>\n')
out += (' </button>\n')
}
else{ // rs not empty
temp_subcat= ""; //this string used to group records by subcategory
fields = new Object(); // this object used to store fields in records
while (! (rs.EOF)){
// clean up data and put it into the fields object:
for ( field_number = 0; field_number < rs.fields.count ; field_number++ )
{
temp_field = String(rs.fields(field_number).Name);
temp_content = String(rs.fields.item(temp_field));
temp_content = temp_content.replace(/'/g,"'");
if (temp_field.search(/date/) > 0 ) // check for date fields
{temp_content = slash_date(temp_content);}
else if (temp_content == "null") {temp_content = ""; }
fields[temp_field] = temp_content
} // end looping through fields in current record
// subcategories: when we get to a new one, display it
if (temp_subcat != fields.data_subcategory){
temp_subcat = fields.data_subcategory;
}
if (temp_subcat == currentWeek){
out += (' <data>\n')
out += (' <name>'+fields.data_name+'</name>\n')
out += (' <info>'+fields.data_url+'</info>\n')
out += (' <id>'+fields.data_uid+'</id>\n')
out += (' </data>\n')
} else {
}
rs.move(1);
} // end while recordset
// end else (rs not empty)
rs.Close ();
}
if (out==""){
out += (' <data>\n')
out += (' <name>No articles.</name>\n')
out += (' <info>There are no new events for this week.</info>\n')
out += (' <id>undefined</id>\n')
out += (' </data>\n')
}
Response.Write(out)
Conn.Close ();