Author: echuck
Date: Sun Jan 22 20:01:53 2006
New Revision: 4583
Modified:
Webware/trunk/MiddleKit/Run/MSSQLObjectStore.py
Log:
Fix a bug with passing the 'database' argument.
Modified: Webware/trunk/MiddleKit/Run/MSSQLObjectStore.py
==============================================================================
--- Webware/trunk/MiddleKit/Run/MSSQLObjectStore.py (original)
+++ Webware/trunk/MiddleKit/Run/MSSQLObjectStore.py Sun Jan 22 20:01:53 2006
@@ -63,10 +63,17 @@
#print '>> connection string=%r' % s
conn = self.dbapiModule().DriverConnect(s)
else:
+ # extract the database arg if it was provided
+ if args.has_key('database'):
+ database = args['database']
+ del args['database']
+ else:
+ database = None
conn = self.dbapiModule().connect(**args)
cur = conn.cursor()
try:
- sql = 'use '+self._model.sqlDatabaseName()+';'
+ db = database or self._model.sqlDatabaseName()
+ sql = 'use '+db+';'
#print '>> use string=%r' % sql
cur.execute(sql)
except Exception, e:
|