read record from database