Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Rob Vleeschhouwer
  Where is Rob Vleeschhouwer?
 Leeuwarden
 Netherlands
 Rob Vleeschhouwer
 Tags
Subject: RE: zap
Thread ID: 143229 Message ID: 143632 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 30, 2007 1:07:00 PM         
   


> In fact the command 'set exclusive on' is allready in the main programm. And nowhere
> there is a 'set exclusive off'
> I do not want to spend a lot of time to it. I use now 'delete all' instead.
> I know the concequenses of that.

In that case the issue is either that the table was already open before the SET EXCLUSIVE ON executes, or you are in a different datasession and have no explicitly set EXCLUESIVE=ON in that datasession.

EXCLUSIVE is one of many commands that are scoped to a datasession and which must be set explicitly whenever you create a new datasession. For the full list of affected commands see "SET DATASESSION" topic in the help file.

The easy way to deal with this in forms is to create an environment-setting class and add it to your form base class LOAD() so that even if the form creates its own data session, the setttings are all handled. We use this code in our root class:

SET TALK OFF
*** Set environment
Thisform.NewObject( 'oStdEnv', 'StdEnv', 'StdCustom.vcx' )


The class has "set", "reset" and "savesettings" methods. We call the SET from the Init() so that just instantiating the class sets the settings, and saves the relevant ones if we are running in Dev Mode. The class Destroy() calls the reset() method so that settings are automatically restored when we are in Dev Mode.

SET TALK OFF
*** Set the environment
*** If we're running an executable, there is no need to save settings
IF VERSION( 2 ) # 0
  SET ESCAPE ON
  SET ASSERTS ON
  This.SaveSettings()
ELSE
  SET ESCAPE OFF
  SET ASSERTS OFF
  SET STATUS BAR OFF
ENDIF
SET SAFETY OFF
SET EXCLUSIVE OFF
SET DELETED ON
SET CONSOLE OFF
SET DATE AMERICAN
SET STATUS OFF
SET DEBUG ON
SET DECIMALS TO 6
SET FIXED OFF
SET SYSFORMATS OFF
SET CENTURY OFF ROLLOVER 60
SET ANSI OFF
SET CONFIRM ON
SET DELETED ON
SET EXACT OFF
SET EXCLUSIVE OFF
SET MULTILOCKS ON
*** Is the first day of the week Monday? For a business, I would think so.
SET FDOW TO 2
SET FULLPATH ON
SET MEMOWIDTH TO 50
SET NOTIFY OFF
SET NULL OFF
SET NULLDISPLAY TO ' '
SET REPROCESS TO 10 SECONDS
SET SAFETY OFF
SET STRICTDATE TO 0
SET TEXTMERGE ON
SET CPDIALOG OFF

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

zap Posted by Rob @ 8/26/2007 1:41:36 PM
RE: zap Posted by Mike Gagnon @ 8/26/2007 2:18:12 PM
RE: zap Posted by Rob @ 8/27/2007 1:50:26 PM
RE: zap Posted by Andy Kramek @ 8/27/2007 2:30:39 PM
RE: zap Posted by Rob @ 8/30/2007 10:41:30 AM
RE: zap Posted by tushar @ 8/30/2007 10:44:05 AM
RE: zap Posted by Rob @ 8/30/2007 11:26:19 AM
RE: zap Posted by Rob @ 9/3/2007 6:17:17 PM
RE: zap Posted by Ken Murphy @ 9/3/2007 6:37:03 PM
RE: zap Posted by Rob @ 9/3/2007 7:09:05 PM
RE: zap Posted by Ken Murphy @ 9/4/2007 1:19:09 AM
RE: zap Posted by Andy Kramek @ 8/30/2007 1:07:00 PM
RE: zap Posted by Rob @ 8/30/2007 7:58:17 PM
RE: zap Posted by Massimo Tombesi @ 8/27/2007 2:50:51 PM
RE: zap Posted by Cetin Basoz @ 8/30/2007 1:19:23 PM