Page 1 of 1

USE command to repeat open

Posted: Thu Jul 05, 2012 8:54 am
by apichit
Hi All!

I use USE command to open .dbf file on server.
When I run the program it cannot open file due to other person open the file.
Can anyone tell me how to repeat open until successful open?

Regards.

Re: USE command to repeat open

Posted: Thu Jul 05, 2012 4:55 pm
by Czarny_Pijar
The easiest way to achieve this is the shout in the office:
Hey guys! Let close your programs for a while, I need the exclusive access to the databases!

If you are the programmer instead, then you need some knowledge about USE ... SHARED, NETERR(), RLOCK(), DBUNLOCK() and USED().

Re: USE command to repeat open

Posted: Thu Jul 05, 2012 5:36 pm
by esgici
Hi Apichit
apichit wrote:...
Can anyone tell me how to repeat open until successful open?
While programmers become day to day more busy and lazy, liability of such operations assigned to database servers ;)

But what we can find some old fashioned information some deserted places.

Here you can find some info on Network Programming.

Two little function derived that book :

A little function for file locking :
Function for persistent file locking
Function for persistent file locking
FunFLock.PNG (25.72 KiB) Viewed 8933 times
and another little function function for USE command on network environment :
Function for USE in network
Function for USE in network
FunNetUse.PNG (32.69 KiB) Viewed 8933 times
I hope that will help you.

Happy HMG'ing :D

Regards

--

Esgici

Re: USE command to repeat open

Posted: Fri Jul 06, 2012 2:09 am
by apichit
Thank you very much Czarny_Pijar, Esgici.