Edited database access method

Using logindb module for access