Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connection with SQL Server
#1
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:

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()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Networking Issues - Python GUI client and server connection always freezes Veritas_Vos_Liberabit24 0 679 Mar-21-2023, 03:18 AM
Last Post: Veritas_Vos_Liberabit24
  Mysql error message: Lost connection to MySQL server during query tomtom 6 15,685 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  pysql connection to cloud server database times out Pedroski55 9 4,592 Oct-11-2021, 10:34 PM
Last Post: Pedroski55
  Serial connection connection issue Joni_Engr 15 7,836 Aug-30-2021, 04:46 PM
Last Post: deanhystad
  How to take the tar backup files form remote server to local server sivareddy 0 1,871 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  ws server exit after getting 1 connection korenron 3 5,382 Feb-04-2021, 07:49 PM
Last Post: nilamo
  Connection timed out error when connecting to SQL server kenwatts275 2 3,275 Jun-02-2020, 07:35 PM
Last Post: bowlofred
  Windows server 2008 SP2 - Python cx_Oracle connection DLL error tpanagoda 2 5,000 Mar-05-2018, 04:35 AM
Last Post: tpanagoda
  Problem with connection: Python + SQL Server carlos_123 2 5,206 Feb-13-2018, 06:13 PM
Last Post: carlos_123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020