title: Passing a parameter to a sql query using pyodbc failing
body: <p>I have read dozens of similar posts and tried everything but I still get an error message when trying to pass a parameter to a simple query using pyodbc. Apologies if there is an answer to this elsewhere but I cannot find it</p>
  
  <p>I have a very simple table:</p>
  
  <pre><code>select * from Test
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>a
  b
  c
  </code></pre>
  
  <p>This works fine:</p>
  
  <pre><code>import pyodbc
  import pandas
  connection = pyodbc.connect('DSN=HyperCube SYSTEST',autocommit=True)
  result = pandas.read_sql("""select * from Test where value = 'a'""",connection,params=None)
  print(result)
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>  value
  0     a
  </code></pre>
  
  <p>However if I try to do the where clause with a parameter it fails</p>
  
  <pre><code>result = pandas.read_sql("""select * from Test where value = ?""",connection,params='a')
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>Error: ('01S02', '[01S02] Unknown column/parameter value (9001) (SQLPrepare)')
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>cursor = connection.cursor()
  cursor.execute("""select * from Test where value = ?""",['a'])
  pyodbcResults = cursor.fetchall()
  </code></pre>
  
  <p>and still received the same error</p>
  
  <p>Does anyone know what is going on? Could it be an issue with the database I am querying?</p>
  
  <p>PS. I looked at the following post and the syntax there in the first part of answer 9 where dates are passed by strings looks identical to what I am doing</p>
  
  <p><em>pyodbc the sql contains 0 parameter markers but 1 parameters were supplied' 'hy000'</em></p>
  
  <p>Thanks</p>