Orgil,
I have connected successfully using 2.6 and 2.7. It took me quiet a
while to make the connection, but all of the problems I had connecting
were in setting up the ODBC driver. Once I got it setup, the pyodbc
connection was trivial. I am still having other problems with pyodbc
as you can see from my earlier post.
I have inserted the first few lines of some code that I am using to
test database triggers. The DSN was created within "ODBC Manager" on a
Mac OS 10.6.6 box. The DSN, as set up by the ODBC Manager has the
server name, the server address, and the instance name bound to it. I
have connected to several instances of MS SQL Server 2008 on sever
using this approach.
Mark
import pyodbc
from unittest import TestCase, main
from datetime import datetime
class Test(TestCase):
def setUp(self):
conn = pyodbc.connect("DSN=deepthought-animal-
msharp;UID=msharp;PWD=password")
cursor = conn.cursor()
cursor.execute('''
delete from accounts
where account in ('1111-11-11', '2222-22-22',
'3333-33-33',
'4444-44-44') ''')
conn.commit()