Index
2009-05-04 22:15 – Roger Lovelock : [dabo-users] SQLite and Dabo with Vista
2009-05-04 23:55 – Paul McNett : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-04 23:57 – Roger Lovelock : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 00:02 – Paul McNett : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 00:09 – Paul McNett : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 00:27 – Roger Lovelock : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 00:39 – Roger Lovelock : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 00:51 – Roger Lovelock : Re: [dabo-users] SQLite and Dabo with Vista
2009-05-05 01:44 – Paul McNett : Re: [dabo-users] SQLite and Dabo with Vista
Back to top
[dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

Posted: 2009-05-04 22:15:21   Link

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
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Paul McNett

Posted: 2009-05-04 23:55:35   Link

Roger Lovelock wrote:

> 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 cop

y

> 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.

> I have checked out all the obvious things - any suggestions much appreciated!

What's the name of the sqlite database? How does your app determine where to find the

sqlite data?

Paul

©2009 Paul McNett
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

Posted: 2009-05-04 23:57:12   Link

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
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Paul McNett

Posted: 2009-05-05 00:02:34   Link

Roger Lovelock wrote:

> 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?

Well, please do a complete filesystem search on the name of your sqlite database, and

then determine which is being used by the app. Then we can figure out why it is using

that one and not the one you expected.

My money is on the working directory being not what you expect.

Paul

©2009 Paul McNett
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Paul McNett

Posted: 2009-05-05 00:09:00   Link

Paul McNett wrote:

> My money is on the working directory being not what you expect.

See this thread:

http://www.eggheadcafe.com/software/aspnet/30133368/vista-createfile-and-sha.aspx

Are you putting the data in the Program Files directory? That's a big no-no, and

probably the source of your trouble. Put any data off of Documents and Settings, in

either All Users or a specific user.

When run as administrator, it reads/writes to the copy off of Program Files, because

Administrator has the rights. When run as an unprivileged user, from what I

understand it copies the database into a directory where the user has rights

(probably under Documents and Settings somewhere).

Paul

©2009 Paul McNett
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

Posted: 2009-05-05 00:27:46   Link

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
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

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

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
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Roger Lovelock

Posted: 2009-05-05 00:51:42   Link

Oops - sorry, I'd forgotten I was on the daily digest - which is why I =

wasn't getting the replies - sorry about that - I will change my =

subscription and look at moving my database somewhere more suitable =

(what is a portable solution?)

Roger

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

multipart/alternative

text/plain (text body -- kept)

text/html

---

©2009 Roger Lovelock
Back to top
Re: [dabo-users] SQLite and Dabo with Vista

Author: Paul McNett

Posted: 2009-05-05 01:44:25   Link

Roger Lovelock wrote:

> Oops - sorry, I'd forgotten I was on the daily digest - which is why I wasn't getting the replies - sorry about that - I will change my subscription and look at moving my database somewhere more suitable (what is a portable solution?)

What do you mean by "portable"?

If you mean cross platform, you should save your data in:

import dabo.utils

dabo.utils.getUserAppDataDirectory(appName="My Application")

Paul

©2009 Paul McNett