'Initialize the access system.'

def __init__(self, uri, adultSearch=1, useORM=None, *arguments, **keywords):

    IMDbBase.__init__(self, *arguments, **keywords)
    if (useORM is None):
        useORM = ('sqlobject', 'sqlalchemy')
    if (not isinstance(useORM, (tuple, list))):
        if (',' in useORM):
            useORM = useORM.split(',')
        else:
            useORM = [useORM]
    self.useORM = useORM
    nrMods = len(useORM)
    _gotError = False
    DB_TABLES = []
    for (idx, mod) in enumerate(useORM):
        mod = mod.strip().lower()
        try:
            if (mod == 'sqlalchemy'):
                from alchemyadapter import getDBTables, NotFoundError, setConnection, AND, OR, IN, ISNULL, CONTAINSSTRING, toUTF8
            elif (mod == 'sqlobject'):
                from objectadapter import getDBTables, NotFoundError, setConnection, AND, OR, IN, ISNULL, CONTAINSSTRING, toUTF8
            else:
                self._sql_logger.warn(('unknown    module    "%s"' % mod))
                continue
            self._sql_logger.info('using    %s    ORM', mod)
            for (k, v) in [('NotFoundError', NotFoundError), ('AND', AND), ('OR', OR), ('IN', IN), ('ISNULL', ISNULL), ('CONTAINSSTRING', CONTAINSSTRING)]:
                globals()[k] = v
            self.toUTF8 = toUTF8
            DB_TABLES = getDBTables(uri)
            for t in DB_TABLES:
                globals()[t._imdbpyName] = t
            if _gotError:
                self._sql_logger.warn(('falling    back    to    "%s"' % mod))
            break
        except ImportError as e:
            if ((idx + 1) >= nrMods):
                raise IMDbError(('unable    to    use    any    ORM    in    %s:    %s' % (str(useORM), str(e))))
            else:
                self._sql_logger.warn(('unable    to    use    "%s":    %s' % (mod, str(e))))
                _gotError = True
            continue
    else:
        raise IMDbError(('unable    to    use    any    ORM    in    %s' % str(useORM)))
    self._sql_logger.debug('connecting    to    %s', uri)
    try:
        self._connection = setConnection(uri, DB_TABLES)
    except AssertionError as e:
        raise IMDbDataAccessError(('unable    to    connect    to    the    database    server;    ' + ('complete    message:    "%s"' % str(e))))
    self.Error = self._connection.module.Error
    self._kind = {}
    self._kindRev = {}
    self._sql_logger.debug('reading    constants    from    the    database')
    try:
        for kt in KindType.select():
            self._kind[kt.id] = kt.kind
            self._kindRev[str(kt.kind)] = kt.id
    except self.Error:
        raise IMDbDataAccessError('unable    to    connect    to    the    database    server')
    self._role = {}
    for rl in RoleType.select():
        self._role[rl.id] = str(rl.role)
    self._info = {}
    self._infoRev = {}
    for inf in InfoType.select():
        self._info[inf.id] = str(inf.info)
        self._infoRev[str(inf.info)] = inf.id
    self._compType = {}
    for cType in CompanyType.select():
        self._compType[cType.id] = cType.kind
    info = [(it.id, it.info) for it in InfoType.select()]
    self._compcast = {}
    for cc in CompCastType.select():
        self._compcast[cc.id] = str(cc.kind)
    self._link = {}
    for lt in LinkType.select():
        self._link[lt.id] = str(lt.link)
    self._moviesubs = {}
    for (vid, vinfo) in info:
        if (not vinfo.startswith('LD    ')):
            continue
        self._moviesubs[vinfo] = ('laserdisc', vinfo[3:])
    self._moviesubs.update(_litd)
    self._moviesubs.update(_busd)
    self.do_adult_search(adultSearch)
