I have SQL Server Native Client 11.0 and pyodbc installed using python 2.7. I am able to set the connection correctly within python
import pyodbc
conn = pyodbc.connect('DRIVER={SQL Server Native Client 11.0};SERVER=b;DATABASE=b;UID=b;PWD=b')
cur=conn.cursor()
query=cur.execute('''select top 1 * from table''')
for x in query.fetchall():
print x
Traceback (most recent call last):
File "<module1>", line 8, in <module>
ProgrammingError: ('ODBC SQL type -151 is not yet supported. column-index=40 type=-151', 'HY106')
if i do, i get the same error
for x in query:
print x
how do I return the query?
if I just print query I get pyodbc.Cursor object at 0x02B74AD8
could it be column type it cannot read, there is a point geometry in this table.
UPDATE
the problem is with the point geometry. when I take out the geometry I can return what the cursor contains. however when the geometry column is in there it always throughs this error. I am assuming the pyodbc does not have support for geometric objects... as a work around I can convert to WKT