<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Rich,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 4 Jun 2021, at 20:38, Rich Shepard <<a href="mailto:rshepard@appl-ecosys.com" class="">rshepard@appl-ecosys.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Fri, 4 Jun 2021, Colin McPhail wrote:<br class=""><br class=""><blockquote type="cite" class="">It might be an idea to add some error checking. I put the following just<br class="">after the self.model.select() line:<br class="">...</blockquote></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class="">Perhaps you might see some other message that indicates what's going wrong?</blockquote><br class="">Colin,<br class=""><br class="">Indeed I do. The last few lines of the log file for your modified file shows<br class="">the problem:<br class="">INFO:root:found database<br class="">DEBUG:root:Defining model/view<br class="">DEBUG:root:model error:  Unable to find table foods_episodes<br class="">DEBUG:root:End of Program<br class=""><br class="">Yet when I open foods.db with sqlite-3.34.0 the table is present.<br class=""><br class="">Similarly, when I run my activitytypes.py I get the same error:<br class="">INFO:root:found database<br class="">DEBUG:root:Defining model/view<br class="">DEBUG:root:model error:  Unable to find table activitytypes<br class="">DEBUG:root:End of Program<br class=""><br class="">And that table is present in the bustrac database.<br class=""><br class="">Please suggest how i trace this inability to find database tables to its<br class="">source.<br class=""><br class="">Thanks again,<br class=""><br class="">Rich<br class=""></div></div></blockquote></div><br class=""><div class="">The Qt documentation for QSqlDatabase.setDatabaseName (<a href="https://doc.qt.io/qt-5.15/qsqldatabase.html#setDatabaseName" class="">qsqldatabase.html</a>) says that the QSQLITE driver will create an empty database if it cannot find the specified one. Maybe the QPSQL driver does the same.</div><div class=""><br class=""></div><div class="">Are you certain that</div><div class=""><ol class=""><li class="">You are specifying the correct path to the database, and</li><li class="">The version of datasource.py that you are running has the correction I made to the indentation of the block of code that checks for the presence of the required tables. You should get the "repair the database" message box if an empty database is being used.</li></ol><div class="">To be certain of using the required database file you could pass a complete path ("/usr/rich/.../foods.db") to setDatabaseName().</div></div><div class=""><br class=""></div><div class="">--</div><div class="">Colin</div></body></html>