Hi
I have written a script connect a table in the database. It works
perfectly when I was doing the testing in the sever.
But i am not able to connect from the client. The client login has the
same premission as the loginning account in the sever.
Any thoughts.
Please see my script below:
In [1]: import pkg_resources
In [2]: pkg_resources.require("SQLAlchemy > 0.5")
Out[2]: [sqlalchemy 0.5.6 (c:\pythonxy\python25\lib\site-packages
\sqlalchemy-0.5
.6-py2.5.egg)]
In [3]: import sqlalchemy
In [4]: import sqlalchemy
In [5]: from sqlalchemy.orm import mapper, sessionmaker
In [6]: from sqlalchemy.sql import select
In [7]: from sqlalchemy import create_engine
In [8]: engine = create_engine('''mssql://W1001252521\NINGSTORAGE/
WeatherDB?trus
ted_connection=yes''')
In [9]: meta = sqlalchemy.MetaData()
In [10]: meta.bind = engine
In [11]: conn = engine.connect()
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (271, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (319, 0))
---------------------------------------------------------------------------
DBAPIError Traceback (most recent call
last)
C:\pythonxy\Python25\Lib\site-packages\<ipython console> in <module>()
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\eng
ine\base.pyc in connect(self, **kwargs)
1219 """Return a newly allocated Connection object."""
1220
-> 1221 return self.Connection(self, **kwargs)
1222
1223 def contextual_connect(self, close_with_result=False,
**kwargs):
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\eng
ine\base.pyc in __init__(self, engine, connection, close_with_result,
_branch)
529
530 self.engine = engine
--> 531 self.__connection = connection or engine.raw_connection
()
532 self.__transaction = None
533 self.__close_with_result = close_with_result
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\eng
ine\base.pyc in raw_connection(self)
1274 """Return a DB-API connection."""
1275
-> 1276 return self.pool.unique_connection()
1277
1278 def _proxy_connection_cls(cls, proxy):
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in unique_connection(self)
117
118 def unique_connection(self):
--> 119 return _ConnectionFairy(self).checkout()
120
121 def create_connection(self):
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in __init__(self, pool)
302 self.__counter = 0
303 try:
--> 304 rec = self._connection_record = pool.get()
305 conn = self.connection =
self._connection_record.get_connect
ion()
306 self._connection_record.backref = weakref.ref
(self, lambda r
ef:_finalize_fairy(conn, rec, pool, ref))
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in get(self)
159
160 def get(self):
--> 161 return self.do_get()
162
163 def do_get(self):
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in do_get(self)
637
638 try:
--> 639 con = self.create_connection()
640 self._overflow += 1
641 finally:
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in create_connection(self)
120
121 def create_connection(self):
--> 122 return _ConnectionRecord(self)
123
124 def recreate(self):
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in __init__(self, pool)
196 def __init__(self, pool):
197 self.__pool = pool
--> 198 self.connection = self.__connect()
199 self.info = {}
200 if pool._on_connect:
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\poo
l.pyc in __connect(self)
259 try:
260 self.starttime = time.time()
--> 261 connection = self.__pool._creator()
262 if self.__pool._should_log_info:
263 self.__pool.log("Created new connection %r" %
connection
)
c:\pythonxy\python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
\sqlalchemy\eng
ine\strategies.pyc in connect()
78 return dbapi.connect(*cargs, **cparams)
79 except Exception, e:
---> 80 raise exc.DBAPIError.instance(None, None,
e)
81 creator = kwargs.pop('creator', connect)
82
DBAPIError: (Error) ('08001', '[08001] [Microsoft][ODBC SQL Server
Driver][DBNET
LIB]SQL Server does not exist or access denied. (17)
(SQLDriverConnectW); [01000
] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect
()). (53);
[01S00] [Microsoft][ODBC SQL Server Driver]Invalid connection string
attribute
(0)') None None
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.