pyodbc the sql contains 0 parameter markers but 1 parameters were supplied' 'hy000'
I am using Python 3.6, pyodbc, and connect to SQL Server. I am trying make connection to a database, then creating a query with parameters. Here is the code: import sys import pyodbc # connection parameters nHost = 'host' nBase = 'base' nUser = 'user' nPasw = 'pass' # make connection start def sqlconnect(nHost,nBase,nUser,nPasw): try: return pyodbc.connect('DRIVER={SQL Server};SERVER='+nHost+';DATABASE='+nBase+';UID='+nUser+';PWD='+nPasw) print("connection successfull") except: print ("connection failed check authorization parameters") con = sqlconnect(nHost,nBase,nUser,nPasw) cursor = con