Pass in database file as a parameter, and add error handling to parameters.