Use of ODBC DSN in TurboGears

1 view
Skip to first unread message

Rudy Schockaert

unread,
Dec 8, 2006, 3:59:59 AM12/8/06
to TurboGears
Hi,

I would like to avoid putting the username and password for my MSSQL
database connection in any script or configuration file. One way of
doing this would be to make use of ODBC DSN's where I can enter the
username and password at config time.

Is this possible with SQLObject or SQLAlchemy?

If someone has an alternative solution to my problem, this would be ok as well.

Thanks in advance,

Rudy

Rudy Schockaert

unread,
Dec 12, 2006, 7:52:02 AM12/12/06
to TurboGears
I found out that when I use SQLObject I can use mssql as database type
in the URI.
If I have the adodbapi module it is also possible to use integrated
security, which is what I want.
I found out that I have to pass 'sspi' as a parameter somehow. Can
someone tell me how I can define the dburi to use sspi?
I tried :

sqlobject.dburi="mssql://localhost/Factory;sspi"

but no avail.

Thanks in advance,

Rudy


--
It is not economical to go to bed early to save the candles if the
result is twins. - Chinese Proverb

Rudy Schockaert

unread,
Dec 12, 2006, 8:01:44 AM12/12/06
to TurboGears
Apparently the following works:

C:\Factory\Factory>tg-admin sql create
Using database URI mssql://localhost/Factory?sspi=true
Exception exceptions.AttributeError: <exceptions.AttributeError instance at 0x00
B39878> in <bound method Transaction.__del__ of <sqlobject.dbconnection.Transact
ion object at 0x015344D0>> ignored

Is this the correct way?
Can I safely ignore the exception?

Reply all
Reply to author
Forward
0 new messages