Moved accessdb function to library