Database Visit function