IT

N

nazrth8591

Hi im trying to have the same file open in access on two different
pc's. So that when the users input data on one it well update the file
so it well show up on the other pc and vaice verse.

can any one PLEASE HELP ME!!!
thank you

Michael
(e-mail address removed)
 
P

Phlip

nazrth8591 said:
Hi im trying to have the same file open in access on two different
pc's. So that when the users input data on one it well update the file
so it well show up on the other pc and vaice verse.

Trivially replace your Access interfaces with Ruby on Rails, running on a
lite web server.

(And because this newsgroup doesn't discuss Access databases, I'm allowed to
recommend that! This group is only qualified to discuss raw C++ itself. Try
an Access newsgroup!)
 
V

Victor Bazarov

Hi im trying to have the same file open in access on two different
pc's. So that when the users input data on one it well update the
file so it well show up on the other pc and vaice verse.

can any one PLEASE HELP ME!!!

I don't think it's a language problem. If your PCs run the operating
systems that allow networking, you should be able to specify the
location of the same file on each of them (it could reside on one of
the systems or on an independent server altogether). The fact that
access to that file has to be _shared_ has nothing to do with the
language. It is achieved through operating system mechanisms, that's
why you need to ask in the newsgroup dedicated to your OS.

V
 
R

Roland Pibinger

I don't think it's a language problem. If your PCs run the operating
systems that allow networking, you should be able to specify the
location of the same file on each of them (it could reside on one of
the systems or on an independent server altogether). The fact that
access to that file has to be _shared_ has nothing to do with the
language. It is achieved through operating system mechanisms, that's
why you need to ask in the newsgroup dedicated to your OS.

It's more a design than an OS problem. The challenge is to ensure that
at the same time only one process accesses the file. It's tedious but
it can (almost) be done in C++ with a lock file. The sketch of a
soulution is presented here:
http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=144&rl=1
.. The solution is incomplete because it doesn't address "if a process
that holds the lock terminates before releasing it".
I have implemented something similar but would not recommend it.
Better use other 'collaborative' protocols (eg. each process writes to
its own file which can be read (but not modified) by all other
processes).

Best regards,
Roland Pibinger
 
M

Michiel.Salters

It's more a design than an OS problem. The challenge is to ensure that
at the same time only one process accesses the file. It's tedious but
it can (almost) be done in C++ with a lock file. The sketch of a
soulution is presented here:
http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=144&rl=1
. The solution is incomplete because it doesn't address "if a process
that holds the lock terminates before releasing it".

Well, that's easily added? Make a global of class type and have the
dtor clean
up. Of course, in the presence of UB that might not work. In the
presence of
UB, *any* C++ construct may fail, so I don't consider it a on-topic
objection.

HTH,
Michiel Salters
 
R

Roland Pibinger

Well, that's easily added? Make a global of class type and have the
dtor clean up. Of course, in the presence of UB that might not work. In the
presence of UB, *any* C++ construct may fail, so I don't consider it a
on-topic objection.

When the process that holds the lock file is terminated unexpectedly
someone has to clean up the situation, ie. programmatically, another
process must delete the lock file and create its own. So the lock file
needs to expire after some time. Then several processes simultanously
try to delete and recreate the lock file. In order to avoid any race
condition a process must create a lock file for the expired lock file
before it can safely delete and recreate it. A 100% safe solution is
not that easy ...
BTW, not only 'UB' can terminate a process. Some operating systems
'freeze' at times or the electric power is simply turned off
inadvertently.

Best wishes,
Roland Pibinger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top