title: Data source name not found and no default driver error
body: <p>This is the code that I have</p>
  
  <pre><code>import time
  import urllib
  import openpyxl
  from sqlalchemy import create_engine, Column, Integer, String, text, Float
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import sessionmaker
  from astropy.table.tests.test_index import engine
  from _sqlite3 import connect
  
  
  connection_string = "DRIVER = {SQL Server};DATABASE =&lt;dbname&gt;; SERVER=&lt;details&gt;; UID =uid; PWD =pwd"
  connection_string = urllib.parse.quote_plus(connection_string)
  connection_string = "mssql+pyodbc:///?odbc_connect=%s" %connection_string
  
  #engine = create_engine('mssql+pyodbc://UID:PWD@Servername:1433/DBname')
  
  engine = create_engine(connection_string)
  
  Base = declarative_base()
  
  class Blc(Base):
      __tablename__ = 'BLC_Database'
  
      Row_no = Column(Integer, primary_key = True)
      date = Column(String)
      RES = Column(String)
      BTTLCOLUMN = Column(String)
      CS_HR = Column(Float)
  
      def __repr__(self):
          return "&lt;BLC_Databse(Row_no = '%d', date='%s', RES = '%s', BTTLCOLUMN = '%s', CS_HR = '%0.2f')&gt;" %(self.Row_no, self.date, self.RES, self.BTTLCOLUMN, self.CS_HR)    
  
  Base.metadata.create_all(engine)
  Session = sessionmaker(bind=engine)
  session = Session()
  
  print('Connection Successful')
  </code></pre>
  
  <p>The error that I am getting is as follows:</p>
  
  <pre><code>sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
  </code></pre>
  
  <p>I am trying to connect to a SQL server. I tried different string options. I visited this <a href="https://stackoverflow.com/questions/17941050/sqlalchemy-connect-to-server-with-not-specify-database">link</a> too. I am not able to understand the error. </p>