Database access check

Added in database access check and error message