Am testing a Project for Shared access, having a DB already open and using a table from it, I want to have this DB set exclusive after an action, so that other users won't be able to login to the sysem. Opening it again Exclusive looks like it works, but it actually doesn't..
No I don't get an error, it just doesn't open it exclusively. I tested it trying to open the DB as another user and it simply opened without giving an error, which means that the DB is still shared.
No I don't get an error, it just doesn't open it exclusively. I tested it trying to open the DB as another user and it simply opened without giving an error, which means that the DB is still shared.
If I open a database (not a table) exclusive, and open a second instance of VFP and try to open the same database shared I get a "access denied" error, not you? Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
Yes.. but my question is (I have the Database open shared, I want to keep it open, and make it exclusive provided that no other users have it open beside me).. Is this possible without closing the database and reopening it exclusive?
Yes.. but my question is (I have the Database open shared, I want to keep it open, and make it exclusive provided that no other users have it open beside me).. Is this possible without closing the database and reopening it exclusive?
As I stated in my first reponse to you, this works exactly like you want
open mydata.dbc shared && Opened shared
open mydata.dbc exclusive && Open exclusive
Without closing the database.
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
am working on VFP 6, and tried what u said on VFP 7 to check out if it depends on the version.. Did you try this?
open mydata.dbc shared && Opened shared
open mydata.dbc exclusive && Open exclusive
then open VFP again and:
open mydata.dbc shared
I tried the above, and the DB simply opens with no errors, which means that it wasn't open exclusive. If you even check the following in the first VFP program:
?ISEXCLUSIVE('mydata',2)
this gives .F. which means that it wasn't open exclusive, while if you open it initially exclusive, it gives .T.
Are you opening a second instance of VFP, meaning you are leaving the first VFP opened? Otherwise if you close the first VFP, you are also closing the database. Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
Yes I have two instances of VFP Open simultaneously, in the first I open DB shared, then Open it again Exclusive.. Having that done, I open exactly the same DB in the second open VFP and it Opens..
First VFP:
Open Database &MyDb Shared
Open Database &MyDb Exclusive
Second VFP:
Open Database &MyDb Shared
And it actually opens without giving (Access Denied) Error.. Which means that the first instance simply doesn't open the DB Exclusively. Perhaps there is No way to open DB Exclusive after it was open shared? Am using VFP 6.0
Doing exactly the same on a win xp pro pc gives me an access denied message when opening the database with the
second VFP.
There must be something that causes the first VFP session to close down.
Am working on win2k, FAT32 .. I asked a colleague to test it on WIN2k NTFS and he gets the same results .. I don't know, this just beats me! Perhaps it's cuz ur using win xp?
Check ur project, looks like u have more than one DB set.
Anyhow, if somebody using DB or table, u will not be able to open it exclusive!!! If you dont get error message, nobody use it or it is not data set. It is simple as that.
If you need it exclusive after opening the table..
try FLOCK() the table and other can only read the table at the maximum. ramani
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.