adding in code to read file name from database table.  Also adding
'WHERE' statement into sqlite queries