/[papo]/gnue/common/src/dbdrivers/mxodbc/DBdriver.py
ViewVC logotype

Diff of /gnue/common/src/dbdrivers/mxodbc/DBdriver.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by styxman, Sat Nov 16 00:19:32 2002 UTC revision 1.6.2.1 by anthonyl, Tue Mar 4 22:09:34 2003 UTC
# Line 16  Line 16 
16  # write to the Free Software Foundation, Inc., 59 Temple Place  # write to the Free Software Foundation, Inc., 59 Temple Place
17  # - Suite 330, Boston, MA 02111-1307, USA.  # - Suite 330, Boston, MA 02111-1307, USA.
18  #  #
19  # Copyright 2000, 2001 Free Software Foundation  # Copyright 2000-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # odbc/DBdriver.py  # odbc/DBdriver.py
# Line 49  try: Line 49  try:
49    # to generate an ImportError early on if not installed.    # to generate an ImportError early on if not installed.
50    from mx import ODBC    from mx import ODBC
51  except ImportError, message:  except ImportError, message:
52    raise GConnections.AdapterNotInstalled, \    tmsg = _("Driver not installed: ODBC\nGrab mxODBC from ") + \
          _("Driver not installed: ODBC\nGrab mxODBC from ") + \  
53           "http://www.lemburg.com/files/python/mxODBC.html\n\n[%s]" % message           "http://www.lemburg.com/files/python/mxODBC.html\n\n[%s]" % message
54      raise GConnections.AdapterNotInstalled, tmsg
55    
56    
57  class ODBC_RecordSet(DBSIG_RecordSet):  class ODBC_RecordSet(DBSIG_RecordSet):
# Line 79  class ODBC_DataObject(DBSIG_DataObject): Line 79  class ODBC_DataObject(DBSIG_DataObject):
79        self._backend = dyn_import("mx.ODBC.%s" % backend)        self._backend = dyn_import("mx.ODBC.%s" % backend)
80        self._DatabaseError = self._backend.DatabaseError        self._DatabaseError = self._backend.DatabaseError
81      except ValueError:      except ValueError:
82        raise GDataObjects.ConnectionError, \        tmsg = _('Invalid service string for ODBC driver.\n') +\
83            _('Invalid service string for ODBC driver.\n') +\               _('Format: service="Backend|DSNString"')
84            _('Format: service="Backend|DSNString"')        raise GDataObjects.ConnectionError, tmsg
85      except ImportError, mesg:      except ImportError, mesg:
86        raise GConnections.AdapterNotInstalled, \        tmsg = _('Unable to load the ODBC drivers for %s') % backend
87            _('Unable to load the ODBC drivers for %s') % backend        raise GConnections.AdapterNotInstalled, tmsg
88    
89      try:      try:
90        self._dataConnection = SIG2api.connect( dsn, \        self._dataConnection = SIG2api.connect( dsn, \

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.6.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26