You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyodbc
Hi,
I am getting an error accessing MSSQL database using pyodbc/TDS
driver. Looks like it has something to do with datetime datatype.
If I deldete the created_at column (which has datetime data type) then
the same code will work. Any suggestion for further debugging? Thanks
in advance. -- TN
here is the python code:
==================
import pyodbc
conn =
pyodbc.connect("DRIVER={FreeTDS};SERVER=myserver;DATABASE=mydatabase;PORT=1435;UID=MYUSER;PWD=MYPASS1")
cursor = conn.cursor()
cursor.execute("select * from test_product")
print cursor.fetchone()
Here is the error:
============
Traceback (most recent call last):
File "testodbc2.py", line 7, in <module>
print cursor.fetchone()
pyodbc.Error: ('HY000', 'The driver did not supply an error!')
Here is the database:
===============
Column name Data Type Value
device varchar(8) xyz
revision varchar(8) ttt
process varchar(10) abc
created_at datetime 4/26/2011 12:20:00 PM
tpnguyen
unread,
Apr 28, 2011, 8:30:15 PM4/28/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyodbc
It turns out that pyodbc was compiled with different
version of unixODBC, so there was a mismatch in the libraries used.
After recompiling pyodbc against the intented version of unixODBC,
things seem to work fine.