Changeset 3029


Ignore:
Timestamp:
Sep 20, 2010 12:51:05 AM (11 years ago)
Author:
wehart
Message:

Bug fixes to allow connection strings to work with Excel data files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/data/db_table.py

    r3027 r3029  
    5252            return
    5353        cursor = self.db.cursor()
    54         # Read the foods table
    55         #print "\nReading foods:\n"
    5654        tmp = []
    5755        if self.options.query is None:
     
    128126                ctype = connection.split('.')[-1]
    129127            connection = self.create_connection_string(ctype, connection, options)
    130             if ctype in ['xls','excel']:
     128            if ctype in ['xls','excel'] or '.xls' in connection:
    131129                return db_Table.connect(self, connection, options, {'autocommit':True})
    132130            return db_Table.connect(self, connection, options)
     
    137135            if ctype in ['mdb', 'access']:
    138136                return "Driver={Microsoft Access Driver (*.mdb)}; Dbq=%s;" % connection
     137            return connection
    139138                   
    140139except ImportError:
Note: See TracChangeset for help on using the changeset viewer.