id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 1412,[patch] ado_mssql queries broken,kent37@…,Adam Vandenberg,"I am new to Django and building a model to show an existing MS SQL Server database using ado_mssql and adodbapi on Windows. I have a simple 'courses' model working and I can call courses.get_list() and get the full list of courses. When I try to do a query such as courses.get_list(code__exact='HR5166') I get a DatabaseError. The error is the same one shown here: http://code.djangoproject.com/ticket/644 The problem is that the %s parameters are never getting converted to ? style - the patched Cursor and Connection code in ado_mssql.py is never executed. The reason the patch code is never executed is because the Connection class is actually defined and accessed in adodbapi.adodbapi (the adodbapi module of the adodbapi package). The current patch only changes the package-level reference to Connection created in adodbapi.__init__, it doesn't change the class actually used in adodbapi.connect() The fix is to patch in both places - the public reference in adodbapi and the module-level reference in adodbapi.adodbapi. Attached is a diff, with this fix I can query my database correctly.",defect,closed,"Database layer (models, ORM)",,normal,invalid,,,Accepted,1,0,0,0,0,0