check if types of database and query match selected program.