Sqlite question

I got a question, an easy one but I tried to find an answer everywhere and I did not find it so probably it is so obvious that I am the only one to don’t get it.

My app is for prof purpose it should be installed on several computers. It is a really app but for some commodity I created a SQLite database to keep data stored. Nobody is allowed to touch it, so everyone will have the SQL file on his computer. This file got all necessary information.
So my App is running well on my computer which is obvious because the application know the path of the database but if I build the app and put the build on another computer the path is lost even if I put the file in the same folder.
So I am completely lost now and I don’t want to connect to a database each time I want to make a request. I want it static. If I need to make an update I just want to replace the file on every computer. (I am on Mac OS X)
Many thanks if you can help me.

Dim f As FolderItem = app.ExecutableFile.Child(“myDatabase.data”)

This finds the data file in the same location as the app.

[quote=74037:@Michel Minot]If I need to make an update I just want to replace the file on every computer. (I am on Mac OS X)
Many thanks if you can help me.[/quote]
Put the database on the server (file server or web server doesn’t matter as long as the user has access) with a text file next to it with a version number.
Have the program check on startup to see if the version number on the server is newer than the version of your database. If so, do a file copy and connect to that.

Thanks a lot David. You are a God! I don’t understand I try to find but even in the xojo documentation I didn’t have a clue of this.

Bob what you say is interesting, so how can I specify the path of the server ?
And another problem is that SQLite is not really good for multi users.
My code will become more complex.

Many Many thanks

The server path is whatever you want. Probably easier to use a local web server. Then you can just use http.get to get the file version and then the database update if necessary.

In the end you will not be using multi user. You will be just deploying updates.

Here are a couple of update plugins I have seen that make things easier:
http://www.monkeybreadsoftware.de/xojo/UpdaterKit/

[quote=74047:@David Cox]Dim f As FolderItem = app.ExecutableFile.Child(“myDatabase.data”)

This finds the data file in the same location as the app.[/quote]
As far as my testings are correct, app.ExecutableFile returns a path to the application and the application is located (on OS X) in the app bundle:contents:MacOS:

And that does not fit my needs. In fact I wanted to ask why, but I forgot.
Why or how can that be usefull ?

[quote=74050:@Bob Coleman]Put the database on the server (file server or web server doesn’t matter as long as the user has access) with a text file next to it with a version number.
Have the program check on startup to see if the version number on the server is newer than the version of your database. If so, do a file copy and connect to that.[/quote]

with a text file next to it with a version number
Why ?

Add in the database a Table with one record that will holds the version number (and probably some more important informations…

[quote=74175:@Emile Schwarz]>with a text file next to it with a version number
Why ?

Add in the database a Table with one record that will holds the version number (and probably some more important informations…[/quote]
Bandwidth.

To open a sqlite file across any connection you end up downloading the file. If you only need to download it when there are updates it is better to have a version indicator to the side of the file.

A resource database we had here before I switched to a web service was about 30MB. If I made the user re-download that file each time they started the program I would 1) have a lynch mob after me and 2) would suck up a lot of bandwidth.

100 users * 30MB file = 3GB of unnecessary bandwidth expense

100 users * 1kb file = 0.00001GB of acceptable bandwidth expense and a quicker start up for the user.