Jan-27-2019, 01:11 PM
Hello all!
I'm trying to connect to SQL Server, but i keep getting the message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)'.
I'm using Pycharm, and i also made sure i installed pyodbc and pypyodbc.
Any Suggestiongs?
Here is my code:
I'm trying to connect to SQL Server, but i keep getting the message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)'.
I'm using Pycharm, and i also made sure i installed pyodbc and pypyodbc.
Any Suggestiongs?
Here is my code:
import pyodbc
class DBConn:
conn = pyodbc.connect("Trusted_Connection='yes';"
"driver='SQL Server}';"
"server='my Server';"
"database='QUERYTRAINING")
if conn:
print("We are connected")
conn.close()
