Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nasty error 1548
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00088200
Message ID:
00088335
Views:
42
>>>Hi All,
>>>
>>>Table "alias" has one or more non-structural indexes open. Please close them and retry the Begin Transaction (Error 1548)
>>>
>>>Did someone come across this one already ? It’s new for me . Happens when I try to update a table from a view, as soon as the code in the update trigger hits the « BEGIN TRANSACTION » line.
>>>As usual the message is very informative. The view is indexed (to a temp CDX) and if I remove the indexes, the problem is still there. The table is indexed, as you may imagine, but uses a conventional CDX.
>>>
>>>Happens on the primary bizobj of a cBizObjForm with several bizObjs on it. (in Codebook parlance)
>>>
>>>So what ?
>>>
>>>Jose
>>
>>I know this error. I got It when I used Indexes which I put on a variety of related tables with the INDEX ON eExpression TAG tagname OF cdxname.CDX command. To avoid it I had to CLOSE INDEXES before starting a Transaction and reissue the INDEX ON ... Command when the Indexes are needed again.
>
>Regine,
>I've been using indexed views for more than 18 months and this is the first time I get stopped in an update. I've tried the CLOSE INDEXES to no avail and it makes sense since the essence of the error message, as I understand it is "close all you IDX indexes before entering a transaction, because I won't be able to revert them if necessary". And I don't have any IDX index open.
>
>What happens in my case is, I guess, an erroneous error message.
>
>José
The solution…

I have 2 different bizobjs with several common controls. One that accepts the search parameters and another to display the information.

Some of these common controls are based on a subclass of cifCombobox (a cifComboBox based on a view rather than on a cursor). In order to have this design work properly I need to index the view.
This was done in the init() of the DataEnvironments definitions.

The problem is that the views were indexed 2 times and this produced 2 different indexes on the same field, enough to make the RI code bomb ! The trick is to bracket the indexing as follows :

IF EMTPY(TAG(1))
INDEX ON … TAG …
ENDIF

Jose
**************************************************
*-- Class:        cifviewcombobox (c:\cdbk30\common30\libs\ccustctl.vcx)
*-- ParentClass:  cifcombobox (c:\cdbk30\common30\libs\ccustctl.vcx)
*-- BaseClass:    combobox
*-- a specialized cifcombobox using views
*
#INCLUDE "c:\cdbk30\common30\include\framincl.h"
*
DEFINE CLASS cifviewcombobox AS cifcombobox


	RowSourceType = 2
	Name = "cifviewcombobox"


	PROCEDURE Init
		LOCAL lcTag
		lcTag = ALLTRIM(this.cTag)
		*-- overwrite the default CifComboBox code to take my changes
		*-- into account
		*-- Validate the tag
		IF !IsTag(this.cTag, this.cAlias)
		  this.lInitialized = .F.
		  WAIT WINDOW NOWAIT TAGNOTFOUND_LOC + CHR(13) + lcTag
		ENDIF

		this.requery()
		NODEFAULT
	ENDPROC


	PROCEDURE Requery
		LOCAL lnOldSel
		lnOldSel = SELECT()
		SELECT (this.rowSource)
		REQUERY()
		SELECT (lnOldSel)  
	ENDPROC


	PROCEDURE copyright
		*---------------------- Location Section ----------------------
		*  Library...........:
		*  Class.............: Cifviewcombobox
		*  Method............:
		*-------------------------- Copyright -------------------------
		*  Author............: José Constant                      
		*  Project...........: PROSAL                             
		*  Created...........: 17/03/98  14:17:39
		*  Copyright.........: (c) Terre-Engineering S.A.             , 1998
		*----------------------- Usage Section ------------------------
		*) Description.......: This is a specialized cifComboBox
		*                    : It's based on a view
		*  Scope.............:
		*  Parameters........:
		*$ Usage.............:
		*% Example...........:
		*  Returns...........:
		*------------------- Maintenance Section ----------------------
		*@ Inputs:...........:
		*  Outputs...........:
		*  Pre-condt. invar..: Be sure to fill in the following properties
		*                    : BoundColumn: the select order of the unique id field in the view (ex: 1)
		*                    : cAlias: the view name, with "r" or "v" removed (ex: "v_Dojo"
		*                    : cField: the name of the field you want to display in the combo when closed
		*                    :   (ex: " cClubNo")
		*                    : cTag: the name of the index tag that will be used for the lookup (ex: "ClubNo")
		*                    : YOU MUST INDEX THE VIEW AND CTAG MUST BE THE CURRENT ORDER!
		*  Post-condt.invar..:
		*? Notes.............: None
		*  Collab.methods....: None
		*--Process...........:
		*  Change log........:
		*--------------------------------------------------------------
	ENDPROC


ENDDEFINE
*
*-- EndDefine: cifviewcombobox
**************************************************
Previous
Reply
Map
View

Click here to load this message in the networking platform