Page 1 of 1

Complex situation and DB

Posted: Tue Apr 03, 2018 9:02 am
by MaxV
Hi,
I post here because is not really DB related.
Question n.1
I have an app that connect to an SQLITE DB.
If the EXE is on a shared folder the DB in the same folder (so I use relative path), can the remote user launch the EXE and using it or the path is messed?

Question n.2
I have an app that connect to an MySQL DB (MariaDB).
If the EXE is on a shared folder and the DB in the localhost, can the remote user on another PC launch the EXE and using it or the server path is messed?

Re: Complex situation and DB

Posted: Thu Apr 05, 2018 2:45 pm
by AxWald
Hi,
MaxV wrote:
Tue Apr 03, 2018 9:02 am
Question n.1
I have an app that connect to an SQLITE DB.
If the EXE is on a shared folder the DB in the same folder (so I use relative path), can the remote user launch the EXE and using it or the path is messed?
I've found out that using relative paths with databases is calling for problems. So I'd strongly suggest the use of absolute paths - they are easy enough to construct.

In your case this may work - the target db should be the same, no matter from where the .exe is called. Assuming Win as OS (".exe") and a fixed LC version (because you'll find differences in working/ not working of relative paths in different OS and LC versions).
MaxV wrote:
Tue Apr 03, 2018 9:02 am
Question n.2
I have an app that connect to an MySQL DB (MariaDB).
If the EXE is on a shared folder and the DB in the localhost, can the remote user on another PC launch the EXE and using it or the server path is messed?
I'd assume the db is searched on the machine from where the .exe is called.

Have fun!

Re: Complex situation and DB

Posted: Tue Apr 10, 2018 10:52 am
by MaxV
I have done some tests for the sqlite DB.
Using local path and same folder of exe and sqlite file is the best option.
This way many users on different PCs can use the same EXE and the same DB those are on a shared folder.

I'll investigate on the MySQL case.