Hi all,
there is my problem:
- I have Macbook with M2 chip => on it I have started programming with python
- Second is a windows laptop, where I have a sql server => database
- I tried to use pyodbc to connect to this database … m2 chip => I had to install homebrew and brew unixodbc … etc
- I have finally this code to connect …
drivers = pyodbc.drivers()
for d in drivers:
print(d)
conn = pyodbc.connect('DRIVER={ODBC Driver 18 for SQL Server}; \
Server=SERVER-NAME; \
Database=DTB-NME; \
User ID=USERNAME; \
Password=PASS')
cursor = conn.cursor()
cursor.execute('SELECT name FROM cars')
for i in cursor:
print(i)
AND … this ERROR :
pyodbc.OperationalError: ('HYT00', '[HYT00]
[Microsoft][ODBC Driver 18 for SQL Server]
Login timeout expired (0) (SQLDriverConnect)')
Can you help me ? … I have MacBook and work in python only few days … thanks a lot, indeed !!!