Integers cannot be passed as Bind Parameter on Python 3 (MS Access)
See original GitHub issueSee 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:
- Created 8 years ago
- Comments:14 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SpringsTea - This issue was fixed in 4.0.8 and then broken again in 4.0.25. See #509 for the current status.
@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 setinfo.ParameterType
toSQL_INTEGER
if the driver does not supportSQL_BIGINT
or (perhaps simpler) if the number is small enough to fit in anSQL_INTEGER
.I have not written any C/C++ in over 10 years but I might try my hand at a fix.