Re: [dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

Posted: 2009-05-05 at 00:39:28

Apologies for sending this post in this way - I am only seeing Pauls =

responses on the web-site - has not come through my mailbox yet!

I establish my link to the database with the following code as part of =

the after-init on my first (mainmenu) screen, which is the only entrance =

point for the app :-

ci =3D dConnectInfo(DbType=3D"SQLite", =

Database=3Dos.path.join(self.Application.HomeDirectory, =

"LodgeBooks.db3"))

self.Application.addConnectInfo(ci, "LodgeBooks")

I should mention I originally used the following :-

ci =3D dConnectInfo(DbType=3D"SQLite", Database=3D"LodgeBooks.db3")

self.Application.addConnectInfo(ci, "LodgeBooks")

but changed it to the above to try to ensure I got the right database =

(didn't seem to make any difference).

Within each Bizobj I then get my connection as follows :-

accountsBizobj =3D =

AccountsBizobj(self.Application.getConnectionByName("LodgeBooks"))

accountsBizobj.requery()

self.DataSet =3D accountsBizobj.getDataSet() etc etc

Roger

From: Roger Lovelock=20

Sent: Tuesday, May 05, 2009 2:27 PM

To: dabo-users@leafe.com=20

Subject: Re: SQLite and Dabo with Vista

I have done a system wide search for my database file and renamed all =

instances other than the one in my production folder - I still see that =

old data appears if I run my app normally and correct data if I run as =

administrator. I think the answer lies in the 'caching' I have seen =

referred to on some posts on other web sites. Is it possible to force =

the app to run as administrator eg by some entry in the manifest file or =

similar? Alternatively if the 'caching' could be turned off by file ...

Thanks

Roger

From: Roger Lovelock=20

Sent: Tuesday, May 05, 2009 1:57 PM

To: dabo-users@leafe.com=20

Subject: Re: SQLite and Dabo with Vista

Further I now find that if I run as administrator the correct data is =

displayed, otherwise it is not. Also, some web searches reveal people =

with similar problems in other programming environments with Vista and =

SQLite where there is a 'shadow' copy of the database ie Vista is =

caching old data somehow. Please - someone out there must have a =

solution for me.

nb will this cause problems for the preferences database in dabo also?

Roger

From: Roger Lovelock=20

Sent: Tuesday, May 05, 2009 12:15 PM

To: dabo-users@leafe.com=20

Subject: SQLite and Dabo with Vista

Have a very strange problem which I cannot fathom! I have moved to Vista =

with a new PC recently. Moved all my software environment over (Python =

2.5, Dabo .9 etc etc as was working fine on XP). I have made some =

changes to my system (mainly a new report which required a new Bizobj as =

well). I develop in DrPython using all of the dabo library etc. I can =

run the system OK from within DrPython (I should mention I use a single =

directory for all files - code, database, rfxml etc). I have tested =

everything is working OK and correct data is displayed on reports from =

within my development directory. I have then pumped everything through =

py2exe and innosetup to create an installer. I have initially tested the =

installer on my own machine. Everything installs correctly into a =

directory under Program Files as intended. When I run the app in this =

location I find that the data being displayed is as the database was =

some time earlier, but when I use SQLiteManager to look at the database =

copy in the directory I am running from it shows the latest data. I did =

have a backup copy of the database in an unrelated directory, but I =

have now renamed that, but with no effect. I add a connection to my =

database to the application object at the start of my Mainmenu program =

and all other screens just get the connection by name.=20

I have checked out all the obvious things - any suggestions =

much appreciated!

Roger

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

©2009 Roger Lovelock