I am afraid I still don’t get it. The documentation says the callable function can return “rows, tables, views or search iterators”, which I thought I did. Lists are also legal - so now I converted the query result to a list of tuples, using fetchall(), and I still get the serialization error:
‘’’ @anvil.server.callable
def urlmapper():
cursor = conn.cursor()
cursor.execute(“select TargetID,D365URL from urlmapper.Target”)
rv = cursor.fetchall()
return rv
‘’’
I have not used pyodbc in a long time but I think this still works:
cursor = conn.cursor()
cursor.execute(“select TargetID,D365URL from urlmapper.Target”) #your code here
columns = [x[0] for x in cursor.description]
results = [ dict( zip(columns, row) ) for row in cursor.fetchall() ]
Working with a MSSQL DB that was running on a .net machine meant in python I ended up using both libraries also. Each one has major defects for certain tasks that are much more of a pain to work around than switch between, iirc.