Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SET EXCLUSIVE OFF command 1

Status
Not open for further replies.

WESLEY55

Programmer
Oct 29, 2003
3
0
0
US
I need to allow the dabases in my application to be shared with other users on a LAN. When I inserted the "SET EXCLUSIVE OFF" command into the program, it compiled, but the databases still cannot be accessed by any other users. Where does this command need to be inserted in the code??
 
If you set it off somewhere in your main program or screen, then it should stay off. There may be somewhere else in the code that has a SET EXCLUSIVE ON command which is setting it back again. Or there may be lines like:

USE blah.dbf IN 0 EXCLUSIVE

... in which case the SET EXCLUSIVE setting is overridden.

Also, it may be that the users don't have rights to the files - try logging in as an admin.

If you copied the data files off a CD they'll be read-only, you need to take that off in Windows or with the ATTRIB command at a prompt.

***************************************
Need help running those old FoxPro apps on modern systems?
 
Again one thing, find FLOCK() statement in your code bcoz, FLOCK() stop sharing.

try this test on LAN

*******************
clos data
set excl OFF
use customer
browse
*******************
 
If you are using a VIEW, (e.g. SET VIEW to MYVIEW), which was created with EXCLUSIVE set to ON, you will have to recreate it with EXCLUSIVE set to OFF
 
I DIDN'T USE 'FLOCK' IN MY CODE. WHRE CAN I FIND A SAMPLE PROGRAM THAT WORKS THAT I CAN PLAY WITH ?
 
OK... I'm going to give up on getting my Foxpro program to share. I'm looking toward converting to Microsoft Access. Is there a utility out there that can convert Foxpro source code into Access code?
 
How about when you open your tables. Are you doing it like this:

USE MyTable1 SHARED

Somewhere, something in your code is locking the table. Either using it exclusive or locking it somewhere down the line. Until you determine where that is, you won't be able to share it. And, even if there was a Foxpro to Access converter, the table would still be locked.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Hi WESLEY55

I have already posted some CODE which you try on LAN

*******************
clos data
set excl OFF
use customer
browse
*******************

Another way, if you ready to share your code , you can send to

adv_pack@hotmail.com
 
" I'm going to give up on getting my Foxpro program to share. I'm looking toward converting to Microsoft Access"

Wow, that is a dramatically ill-advised approach.

Foxpro was made for multi-user (shared) applications.

* Is this a new application or are you modifying an existing one?
* Do you have the source code and the FP development environment?

If so, then it is relatively easy to investigate the source of your problems.

However, before I would begin with that, I would ensure myself that there are no network access issues.
* Can the users all 'see' the database directory?
* Can they all Read,Write,Modify,Save docuements (even basic TXT files) in the database directory?

If all of this works well, then it is time to look into the FP application. You can use the Windows Search/Find utility to search for the occurances of certain Text phrases within your PRG files. Words like: EXCL etc might be found to be causing problems within specific PRG files.

Additionally you might be having problems with the basic TEMP files used to launch Foxpro. These are set in the CONFIG.FP or .FPW file. Perhaps they are the source of your user's problems.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
I agree with jrbbldr. Although FoxPro for DOS/Windows was written about 8-10 years ago, it is still a good solid program. Of course Visual FoxPro is a giant step (or leap) forward. But I would not jump ship and switch to Access simply for this sharing issue. There must be something wrong with either your installation, default settings or code that is the cause of your difficulty. Once you get this issue resolved, you'll be happy you stayed.

Perhaps you just are not familiar yet with the way FoxPro does file sharing. If you're progressing from single-user applications into a networked and shared files environment, expect a learning curve and a few drops of sweat. It won't be long until those concepts and methods are virtually automatic.

As an example, a while back, by way of brute-force testing, I compared the way dBase and FoxPro handled sharing when opening tables and here are my conclusions:

Code:
EXCLUSIVE / NOUPDATE
 - dBase  NOUPDATE ignores EXCLUSIVE STATUS
 - FoxPro NOUPDATE still opens using EXCLUSIVE ON/OFF

EXCLUSIVE / AGAIN
 - dBase  AGAIN works if SET EXCLUSIVE OFF
 -  (file level detection!)
 - FoxPro AGAIN always works
 -  (user level detection!)

APPEND FROM
 - dBase can always APPEND FROM a table in use
 - FoxPro cannot APPEND FROM a table in use if SET EXCLUSIVE ON

Do not give up on FoxPro. It is an excellent programming environment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top