ported database connectivity to adodb (http://adodb.sourceforge.net/)

The queries could still use a good clean up but the connectivity and database calls are changed.