Database creation and opening working