(self, db_key, conn_key=None, db_name=None)
return conn_str
Return a connection string to use with odbc
Return a connection string to use with odbc
Return a connection string to use with odbc
def _conn_string_odbc(self, db_key, conn_key=None, db_name=None):
        """Return a connection string to use with odbc"""
        if conn_key:
            dsn, host, username, password, database, driver = conn_key.split(":")
        else:
            dsn, host, username, password, database, driver = self._get_access_info(db_key, db_name)

        conn_str = 'ConnectRetryCount=2;'
        if dsn:
            conn_str += 'DSN={};'.format(dsn)

        if driver:
            conn_str += 'DRIVER={};'.format(driver)
        if host:
            conn_str += 'Server={};'.format(host)
        if database:
            conn_str += 'Database={};'.format(database)

        if username:
            conn_str += 'UID={};'.format(username)
        self.log.debug("Connection string (before password) %s", conn_str)
        if password:
            conn_str += 'PWD={};'.format(password)
        return conn_str
def _conn_string_odbc ( self , db_key , conn_key = None , db_name = None ) : if conn_key : dsn , host , username , password , database , driver = conn_key . split ( ":" ) else : dsn , host , username , password , database , driver = self . _get_access_info ( db_key , db_name ) conn_str = 'ConnectRetryCount=2;' if dsn : conn_str += 'DSN={};' . format ( dsn ) if driver : conn_str += 'DRIVER={};' . format ( driver ) if host : conn_str += 'Server={};' . format ( host ) if database : conn_str += 'Database={};' . format ( database ) if username : conn_str += 'UID={};' . format ( username ) self . log . debug ( "Connection string (before password) %s" , conn_str ) if password : conn_str += 'PWD={};' . format ( password ) return conn_str