exclusive open... 
Author Message
 exclusive open...

Hi,

I have a problem with use of the tables. I have a simple FoxPro Application
which contains a menu. First item in the menu is wizard one to many table
and second one is generating the report with SQL Select to Cursor and then
to report print...
There is a table common among them giving the problems of exclusive use
where I never used USE/EXCLUSIVE at all because I am using the wizard for
one to many and SQL Select.

Now If I call the report command first, it's fine but if I call the one to
many, then it is saying that file is in use (by the SQl Select used to
generate the report) and vice versa.

My problem is how can I open a table with use of SQL Select in exclusive
mode?

If I can't do this, what is the best solution to do this?

Thanks



Sat, 07 Jan 2006 17:53:31 GMT  
 exclusive open...
Mike,
Check out the setting of EXCLUSIVE.  Even if you don't use the EXCLUSIVE keyword in a use command,
if the setting is ON, tables will be opened exclusively.  The factory default for EXCLUSIVE in
datasession 1 (Default datasession) is ON.

HTH.

--
Larry Miller
MCSD, Microsoft MVP Visual FoxPro
Bifrost Solutions

Quote:

> Hi,

> I have a problem with use of the tables. I have a simple FoxPro Application
> which contains a menu. First item in the menu is wizard one to many table
> and second one is generating the report with SQL Select to Cursor and then
> to report print...
> There is a table common among them giving the problems of exclusive use
> where I never used USE/EXCLUSIVE at all because I am using the wizard for
> one to many and SQL Select.

> Now If I call the report command first, it's fine but if I call the one to
> many, then it is saying that file is in use (by the SQl Select used to
> generate the report) and vice versa.

> My problem is how can I open a table with use of SQL Select in exclusive
> mode?

> If I can't do this, what is the best solution to do this?

> Thanks



Sat, 07 Jan 2006 21:22:17 GMT  
 exclusive open...
Mike, you can also use the ISEXCLUSIVE function to test whether or not a table or DBC is opened exclusively. Here is a short code
example from the help file:

cExclusive = SET('EXCLUSIVE')
SET EXCLUSIVE OFF
SET PATH TO (HOME(2) + 'data\')
OPEN DATA testdata  && Opens the test databsase
USE customer     && Not opened exclusively
USE employee IN 0 EXCLUSIVE    && Opened exclusively in another work area
IF ISEXCLUSIVE( )
 REINDEX  && Can only be done if table opened exclusively
ELSE
  WAIT WINDOW 'The table has to be exclusively opened'
ENDIF
SET EXCLUSIVE &cExclusive

Also, in your scenario, it may be better to just SET EXCLUSIVE OFF at the beginning of your application if you do not require exclusive
access to any of the tables.

--------------------

Quote:
>I have a problem with use of the tables. I have a simple FoxPro Application
>which contains a menu. First item in the menu is wizard one to many table
>and second one is generating the report with SQL Select to Cursor and then
>to report print...
>There is a table common among them giving the problems of exclusive use
>where I never used USE/EXCLUSIVE at all because I am using the wizard for
>one to many and SQL Select.

>Now If I call the report command first, it's fine but if I call the one to
>many, then it is saying that file is in use (by the SQl Select used to
>generate the report) and vice versa.

>My problem is how can I open a table with use of SQL Select in exclusive
>mode?

>If I can't do this, what is the best solution to do this?

>Thanks

--
Gene Goldhammer
Microsoft VSData Team

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified
at http://www.microsoft.com/info/cpyright.htm

Note:  For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.  



Wed, 11 Jan 2006 06:35:28 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Check exclusive open

2. RI-builder => database not exclusive open

3. HELP: Open dbf exclusive in Client Server Network

4. Help, I can open a file exclusive twice.

5. remote view opens exclusive

6. Open EXCLUSIVE

7. OPEN DATA EXCLUSIVE

8. exclusive use open problem

9. File Opens as Exclusive

10. File open EXCLUSIVE?

11. Open Data Exclusive

12. Source Tables EXCLUSIVE when View is opened

 

 
Powered by phpBB® Forum Software