Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Temporary indexes and buffering
Message
From
21/06/2001 09:09:58
 
 
To
20/06/2001 12:26:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00521539
Message ID:
00521851
Views:
17
Hi!

I solved this problem by quite original way. Each time I get that error, I handle it by sending the broadcast messae to all forms in app to notify all grids to remove sorting indexes temporarily. Something like
Form.SetAll('lBeginTransaction',.T.)
before transaction would also help. You can catch such SetAll's in the Assign method for lBeginTransaction property in any control on the form. Usually I do this in the header object that responsible for indexing and knows all information about index.
After transaction ends, I call also Form.SetAll('lBeginTransaction',.F.), that send a notify to controls about ending of transactions. I handle this in my header object and index table again to restore grid order as it was before transaction.

Finally, in most cases you can use CDX structural index that is allowed for transactions and cause no much problems to handle them. You require separate index file only for table opened in shared mode. For all otehr data sources (views, cursors, results of SELET .. INTO CURSOR nofilter command, SPT cursors) you can use native CDX index without limitations. More, when cursor closed, temporary file is deleted as well as CDX file deleted together with it leaving no garbage on disk.

HTH.

>I am using temporary indexes(.idx) to reorder a table in a grid on HeaderClick. On another page of the form the current record can be updated. All indexes are released and the .idx files deleted before attempting a TableUpdate command. However, a "Table has one or more non-structural indexes open. Please close them and retry the Begin Transaction" is returned from one of the database stored procedures. Buffering is type 3 - optimistic row. Ignoring the error continues execution as desired.
>I understand using temporary indexes in VFP is not the best idea. Should I forget about them entirely, or is there a way around this problem?
>Any and all suggestions gratefully received.
>Ben
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform