Lukasz Szybalski wrote:
> On Mon, Mar 31, 2008 at 9:53 AM, Rick Morrison <[EMAIL PROTECTED]> wrote:
>>> So what you are saying here is that sqlalchemy will figure out what driver
>> to use? pyodbc or other?
>>
>>
>> Sort of. Attempts are made to import appropriate modules until one doesn't
>> fail. The order is: [pyodbc, mssql, adodbapi]
>>
>>
>>> I have tried this with svn version and I get
>>> <traceback snipped>:
>>
>> I've tried it with Windows, and the normal DB-URL syntax works. The
>> traceback you give suggests some kind of pydodbc error, but doesn't seem to
>> provide any details. If you're on Linux, I would suspect your FreeTDS /
>> unixodbc / iodbc setup. What sort of error you get when trying to connect
>> using pyodbc without SQLAlchemy?
>>
>
> I usually use dsn and pyodbc. If I use the command Randall emailed:
>
>>>> pyodbc.connect('DRIVER={SQL
> Server};Server=localhost;UID=user;PWD=pass') Traceback (most recent
> call last):
> File "<stdin>", line 1, in ?
> <type 'instance'>: ('IM002', '[IM002] [unixODBC][Driver Manager]Data
> source name not found, and no default driver specified (0)')
>>>> pyodbc.connect('DRIVER={TDS};Server=localhost;UID=user;PWD=pass')
> <pyodbc.Connection object at 0xb7d0b1e0>
>>>> a=pyodbc.connect('DRIVER={TDS};Server=localhost;UID=user;PWD=pass')
>>>> cursor=a.cursor()
>>>> cursor.execute('select * from 17000Z')
> <pyodbc.Cursor object at 0xb7d02db0>
>>>> b=cursor.fetchall()
>
> As you can see I can connect via pyodbc if I pick TDS as a driver. Is
> there a way to tell sqlalchemy ti use TDS driver?
>
> e = sa.create_engine('mssql://user:[EMAIL PROTECTED]:1433/tempdb')
>
> (DRIVER={TDS}
>
> Lucas
>
I'm not certain about this, but it may be the way it's defined in
/etc/odbcinst.ini. Mine looks like this:
[SQL Server]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
CPTimeout =
CPReuse =
Hope that works for you.
Randall
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---