On Jan 14, 2008 3:21 PM, Rick Morrison <[EMAIL PROTECTED]> wrote: > The mssql URI is going to take the same conceptual form as any other > sqlalchemry dburi. The format is documented and available in the SA docs. We > can't give you the exact URI, because it's going to contain things that are > specific to your application, like database name, password, etc. > > ODBC under Linux I can't help you with (yet). Your best bet for MSSQL + *nix > is going to be using pymssql for now. Pymssql (and any other unix-to-MSSQL > connection scheme), is going to require FreeTDS to establish the basic > network connection. Installing FreeTDS on Linux is going to be different for > various distributions, but in general is available via normal package > repositories. From your sig, I'll assume you're looking for a Debian dpkg > package. I know there's one for Ubuntu, which should install on Debian, and > there may be a straight-up Debian package in their repositories as well. > Make sure you get a fairly recent version, as older versions assumed a > Sybase set of connection parameters instead of MSSQL. The FreeTDS docs > outline the issue with the various protocol versions. If you have the > protocol version set wrong, then MSSQL dates won't transfer correctly. Much > of this information is on the SQLAlchemy wiki under database notes, check > there as well.
Here are the instruction on how to setup the dsn in linux using unixODBC and freeTDS http://lucasmanual.com/mywiki/TurboGears#head-bab4c0bbfb83fb7c376a8a0cb68841c4e76ad130 Now I tried connecting to mssql via: ------------------------0.3------------------------ db = sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]/dbname', module=adodbapi) db = sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]/dbname', module=adodbapi) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/__init__.py", line 91, in create_engine return strategy.create(*args, **kwargs) File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/strategies.py", line 41, in create dialect = module.dialect(**dialect_args) File "/usr/lib/python2.4/site-packages/sqlalchemy/databases/mssql.py", line 270, in __init__ ansisql.ANSIDialect.__init__(self, **params) File "/usr/lib/python2.4/site-packages/sqlalchemy/ansisql.py", line 33, in __init__ super(ANSIDialect,self).__init__(**kwargs) File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/default.py", line 34, in __init__ self._figure_paramstyle() File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/default.py", line 96, in _figure_paramstyle self._paramstyle = db.paramstyle AttributeError: 'module' object has no attribute 'paramstyle' trunk: db = sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]/dbname') Traceback (most recent call last): File "<stdin>", line 1, in ? File "sqlalchemy/engine/__init__.py", line 173, in create_engine return strategy.create(*args, **kwargs) File "sqlalchemy/engine/strategies.py", line 62, in create dbapi = dialect_cls.dbapi(**dbapi_args) File "sqlalchemy/databases/mssql.py", line 443, in dbapi raise ImportError('No DBAPI module detected for MSSQL - please install pyodbc, pymssql, or adodbapi') ImportError: No DBAPI module detected for MSSQL - please install pyodbc, pymssql, or adodbapi db = sqlalchemy.create_engine(''mssql://user:[EMAIL PROTECTED]/dbname'', module=adodbapi) Traceback (most recent call last): File "<stdin>", line 1, in ? File "sqlalchemy/engine/__init__.py", line 173, in create_engine return strategy.create(*args, **kwargs) File "sqlalchemy/engine/strategies.py", line 67, in create dialect = dialect_cls(**dialect_args) File "sqlalchemy/databases/mssql.py", line 418, in __new__ return dialect(*args, **kwargs) TypeError: 'NoneType' object is not callable >>> --------------------------------- odbc --------------------------------------- Now I tired the odbc version ---0.3------ eng = create_engine('mssql:///?dsn=MYDSN') Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/__init__.py", line 91, in create_engine return strategy.create(*args, **kwargs) File "/usr/lib/python2.4/site-packages/sqlalchemy/engine/strategies.py", line 52, in create raise exceptions.InvalidRequestError("Cant get DBAPI module for dialect '%s'" % dialect) sqlalchemy.exceptions.InvalidRequestError: Cant get DBAPI module for dialect '<sqlalchemy.databases.mssql.MSSQLDialect object at 0xb7869c0c>' --trunk------ from sqlalchemy import * >>> eng = create_engine('mssql:///?dsn=MYDSN') Traceback (most recent call last): File "<stdin>", line 1, in ? File "sqlalchemy/engine/__init__.py", line 173, in create_engine return strategy.create(*args, **kwargs) File "sqlalchemy/engine/strategies.py", line 62, in create dbapi = dialect_cls.dbapi(**dbapi_args) File "sqlalchemy/databases/mssql.py", line 443, in dbapi raise ImportError('No DBAPI module detected for MSSQL - please install pyodbc, pymssql, or adodbapi') ImportError: No DBAPI module detected for MSSQL - please install pyodbc, pymssql, or adodbapi >>> import adodbapi Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named adodbapi >>> import adodb It seems as the adodbapi is the only one available in unix (debian). Another odbc is ceODBC but I guess sqlalchemy doesn't support that? Do you guys know what is the connection string for adodbapi so I can try to connect just by adodb Thanks, Lucas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---