Hello:
I've made a small accountancy program, I'm asked if it can be made multi-user. So how can a file be accessible by two applications in the same time?
thanks
going multi-user
Re: going multi-user
I think in Windows you can read the same file by multiple programs.
If you're not writing to the file you shouldn't have a problem.
I am a newbie at PureBasic, so I probably do not understand your question fully.
If you're not writing to the file you shouldn't have a problem.
I am a newbie at PureBasic, so I probably do not understand your question fully.
▓▓▓▓▓▒▒▒▒▒░░░░░
Re: going multi-user
By small accountancy program I would assume you are have written some kind of Database application?
This being the case, what database format would you have used to start with?? as this will make a whole bunch of difference between single & multiuser applications of this nature...
More information on just what you have done is really required to answer your questions i think gabriel.
fwiw gabriel, I started to voluntarily write what I think may be a similar application for a firm I am working for which I had running very smoothly using SQLite3. Then all of a sudden I was being asked ( sorry, TOLD) about it being accessed online by all different people working for this firm simultaneously just like all these 'wannabe' online business control systems that never work properly, so I dropped the whole thing with the opinion "If you want something like that, then you are gonna have to pay me at full developer rates!!!!" Needless to say, I never did finish that program..
This being the case, what database format would you have used to start with?? as this will make a whole bunch of difference between single & multiuser applications of this nature...
More information on just what you have done is really required to answer your questions i think gabriel.
fwiw gabriel, I started to voluntarily write what I think may be a similar application for a firm I am working for which I had running very smoothly using SQLite3. Then all of a sudden I was being asked ( sorry, TOLD) about it being accessed online by all different people working for this firm simultaneously just like all these 'wannabe' online business control systems that never work properly, so I dropped the whole thing with the opinion "If you want something like that, then you are gonna have to pay me at full developer rates!!!!" Needless to say, I never did finish that program..

Re: going multi-user
Thanks for reply!
In fact, I developped myself a personnal database system, it's simple ascii text file, with functions like addrecord(), modifyrecord(), deleterecord(), etc......
It's simple and works very good (I don't know any database system).
Essentially, I use FileSeek, WriteString, ReadString to access and modify files.
Now the question is how to access the same file by two differents applications? is simultaneous read and write possible?
I had a look at winapi function CreateFile, I noticed the "dwShareMode" parameter, can this be the solution??
I'll do some tests in the coming days. Meanwhile any help is welcomed!
HANDLE CreateFile(
LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDisposition, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
);
In fact, I developped myself a personnal database system, it's simple ascii text file, with functions like addrecord(), modifyrecord(), deleterecord(), etc......
It's simple and works very good (I don't know any database system).
Essentially, I use FileSeek, WriteString, ReadString to access and modify files.
Now the question is how to access the same file by two differents applications? is simultaneous read and write possible?
I had a look at winapi function CreateFile, I noticed the "dwShareMode" parameter, can this be the solution??
I'll do some tests in the coming days. Meanwhile any help is welcomed!
HANDLE CreateFile(
LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDisposition, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
);
Re: going multi-user
Seeing how easy it is to run a real SQL database, I suggest to go that way.
A little basic info that I've compiled you can find here (you might already have looked at it, dunno
)
http://www.xs4all.nl/~bluez/purebasic/p ... 13.htm#top
A little basic info that I've compiled you can find here (you might already have looked at it, dunno

http://www.xs4all.nl/~bluez/purebasic/p ... 13.htm#top
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )