<p dir="ltr">Is the query executed in GUI thread? </p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 7, 2016, 16:23 Pradip Dattani <<a href="mailto:pradip.dattani@ntlworld.com">pradip.dattani@ntlworld.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="#0563C1" vlink="#954F72" class="gmail_msg"><div class="m_-6671016295225143665WordSection1 gmail_msg"><p class="MsoNormal gmail_msg">We have written our first PyQt (4.6) application. However we have hit a serious road block due to an intermittent database access error.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">The error we see is: <b class="gmail_msg">“[Microsoft][ODBC Driver Manager] Invalid string or buffer length”.</b><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">The application has a number of Tableviews, drop down lists, TreeWidget etc. Most of these are populated dynamically by querying the database.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Database queries are made through custom API code that uses SqlAlchemy. We do not use QtSql module.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">We see this error only when executing a database query from within PyQt application. It’s very random and therefore not a reproducible error. Has anyone seen this before and got any pointers to resolve such issues. We have tried to google. We see many posts but no answers. <u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Are there any good practices we should observe when querying database from within PyQt application.<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Thank you in advance. <u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Regards,<u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg">Pradip<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div></div>_______________________________________________<br class="gmail_msg">
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" class="gmail_msg" target="_blank">PyQt@riverbankcomputing.com</a><br class="gmail_msg">
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" class="gmail_msg" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Oliver</div></div>