[python-win32] python.exe crashes while connecting to MSSQL Database using pyodbc.connect

Tim Golden mail at timgolden.me.uk
Wed Dec 17 15:45:17 CET 2008


siddhartha veedaluru wrote:
>> i have created a System DSN in my local machine using python script which
>> uses ctypes module
>> using pyodbc module i'm trying to connect to remote database.
>>
>> sometimes python.exe crashes in the connect function


Not answering your question directly but... did you know
that you don't need to create a DSN just to connect via
ODBC? This kind of thing will do it just as well:

<code>

import pyodbc

connection = "Driver={SQL Server};Server=SVR;Database=DB;TrustedConnection=Yes"
db = pyodbc.connect (connection)

</code>

TJG


More information about the python-win32 mailing list