For some reason I keep getting an error when trying to run the code below:
pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented (106) (SQLBindParameter)')
I've used pyodbc
many times and have never had this problem before. I have tried this query without params
by including the parameters in the sql
string explicitly and I have the same problem. I am using Python 3.3 and am connected to a MS Access .mdb file.
record = ('1AC401', 'CAB 1', 'OTSG 1 ROOM', 5, 8, 'CD14-PT-05', 'WFB FDWTR WARMING')
cabling_id = '1AC401/CAB 1/OTSG 1 ROOM'
sql = 'UPDATE [CIOC_DATA] SET [charm_enabled] = ?, ' \
'[device_tag] = ?, ' \
'[charm_description] = ?, ' \
'[charm_cabling_id] = ?, ' \
'WHERE [charm_baseplate] = ? ' \
'AND [charm_Address] = ?'
params = ("T", record[5], record[6], cabling_id, record[3], record[4])
cursor.execute(sql, params)
cursor.commit()
Update - I have added the traceback:
Traceback (most recent call last):
File "C:\Users\*****\Documents\Projects\******_******** *** Upgrade\NoEvernote\populateBulkEdit.py", line 48, in <module>
cursor.execute(sql, params)
pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented (106) (SQLBindParameter)')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\******\Documents\Projects\******_******** *** Upgrade\NoEvernote\populateBulkEdit.py", line 52, in <module>
+ ': ' + e.args + '\n' )
TypeError: Can't convert 'tuple' object to str implicitly
Update 2
The TypeError has nothing to do with the underlying problem. It was a secondary mistake with my error handling code. Pay attention only to the pyodbc.Error in the code excerpt above.