Am 06.05.2016 um 03:51 schrieb john:
On 05/05/2016 11:19 AM, john wrote:
Thanks for the code. BTW I normally pass the Datasource and that might a source of the issue - just guessing!
I don't think so. One of my Dabo applications uses next(mydatasource) and that doesn't work either.
OK I haven't been able to fix the next(). This is not the first time I've had this trouble (had it even with the old Dabo). If I had to guess I would say that neither Sqlite or Postgres dbapi modules (sqlite3, psycopg) have a "__iter__" method. Ed and Paul worked mostly with MySQLdb which does have the "__iter__". They may have thought all database modules had it. But I don't really know. Anyway, that's why I think we get the "StopIteration:" exception. Of course this is just a guess and I could be completely wrong!
I never had issues with next() before, and I'm using it in several applications, mostly with PostgreSQL, sometimes with SQLite.
In the past I have always just made my own next() by: Create my own next method and then do get the cursor get the current pk add one to the pk movetoPK(pk)
This works for me because all my PK's are integers. It would not work for other types of PK's.
It would only work if your PK's are (and stay) continuous, no deleting of records. And if the records are sorted by PK.
I've written dabo-dev asking how next() is suppose work. Let's hope that they have an answer and maybe a fix.
I hope so too.
Thank you, Sibylle