def connect_to_db(driver, server, user, password, database):
    if (is_str(driver) and is_str(server) and is_str(user) and is_str(password) and is_str(database)):
        try:
            conn = pyodbc.connect(((((((((('DRIVER={' + driver) + '};SERVER=') + server) + ';DATABASE=') + database) + ';UID=') + user) + ';PWD=') + password), timeout=3)
            print('Connection to', database, 'success')
            return conn
        except (pyodbc.OperationalError or pyodbc.InterfaceError or pyodbc.Error) as error:
            raise ConnectionError(error)
    else:
        raise AttributeError('server | user | password | database were not provided')
def connect_to_db(driver, server, user, password, database):
    if (is_str(driver) and is_str(server) and is_str(user) and is_str(password) and is_str(database)):
        try:
            conn = pyodbc.connect(((((((((('DRIVER={' + driver) + '};SERVER=') + server) + ';DATABASE=') + database) + ';UID=') + user) + ';PWD=') + password), timeout=3)
            print('Connection to', database, 'success')
            return conn
        except (pyodbc.OperationalError or pyodbc.InterfaceError or pyodbc.Error) as error:
            raise ConnectionError(error)
    else:
        raise AttributeError('server | user | password | database were not provided')