Revised settings for Mainwindow.
Fix access on database before database creation.