question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integers cannot be passed as Bind Parameter on Python 3 (MS Access)

See original GitHub issue

See this SA question for details: http://stackoverflow.com/q/20240130

I can reproduce this issue on Windows 10, Python 3.5 32bit, pyodbc 3.0.10. Converting integers to floats before passing them to execute is a work around (as stated in the second answer in the SA question).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gordthompsoncommented, Jul 23, 2019

@SpringsTea - This issue was fixed in 4.0.8 and then broken again in 4.0.25. See #509 for the current status.

1reaction
smsearcycommented, Feb 7, 2017

@gordthompson, I think those logs support my theory that the issue is in Python 3 all integers are longs so they are being bound to SQL_BIGINT which isn’t supported by Access.

It seems that there needs to be a condition in GetLongInfo() that will set info.ParameterType to SQL_INTEGER if the driver does not support SQL_BIGINT or (perhaps simpler) if the number is small enough to fit in an SQL_INTEGER.

I have not written any C/C++ in over 10 years but I might try my hand at a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Optional feature not implemented (106) (SQLBindParameter ...
I'm using MS Access 2010, pyodbc-3.0.7.win32-py3.3.exe, Python 3.3 & PyCharm. Don't judge my coding prowess :) Python is new to me.
Read more >
7. Using Bind Variables - python-oracledb's documentation!
Bind variables can be used to substitute data, but cannot be used to substitute the text of the statement. You cannot, for example,...
Read more >
Parsing arguments and building values — Python 3.11.1 ...
It is possible to pass “long” integers (integers whose value exceeds the platform's LONG_MAX ) however no proper range checking is done —...
Read more >
SQLBindParameter Function - ODBC API Reference
SQLBindParameter binds a buffer to a parameter marker in an SQL ... type of a parameter in a procedure call; parameters whose type...
Read more >
SQL Bind Variables/Parameters in Databases
Bind parameters —also called dynamic parameters or bind variables—are an alternative way to pass data to the database. Instead of putting the values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found