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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Foxpro sp1 vs Visual Foxpro sp2

Status
Not open for further replies.

avsalf

Programmer
Oct 19, 2009
18
CO

hello, when I create a new table or using one table witout CDX TAGS and immediately I create an index the sp2 asks that it be opened in exclusive mode:

xtable = "new" + sys (3)
select * from city into table (xtable)
use (xtable) alias newcity
index on cod_city tag cod_city

What other changes are there with the handling of indices in SP2?
 
This is nothing new, you have always needed to open a table exclusive to create index tags. Could it be that you are used to having "Set Exclusive On" ?
 
I used set exclusive in network environment

when a table does not have structural indexes CDX allowed indexes without opening the exclusive table, I'm using sp2 and I found this problem because in all the programs that use temporary tables I had not opened them in exclusive mode:
Example to reproduce:
in SP1:
use tablex exclusive
delete tag all
use tablex shared
index ON fieldx TAG tagx
in SP2
the last instruction causes the error: file must be open exclusive
 
You are wrong, or your memory is wrong! Re-read my first message. To create an "old fashioned" index file (IDX), you don't need to have the table opened exclusive, but to create an index tag, you must have exclusive access. This has never changed!!!

My guess is that you are mixing tables with cursors. Cursors are exclusive "by design", so to say.
 
Tore is right, to create a structural index tag you are altering the tables structure - storing the tag details in the table and the index in the associated .cdx - so exclusive access is needed.

For an independent idx index there is no structural mod required, so the exclusivity is not needed - but then the idx may not be up to date next time you open the table, because it could have been opened meanwhile without the idx being opened.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Avsalf, I have run your code in SP1. I am seeing the same error that you reported in SP2. The answer to your question is: there are no changes concerning indexes between SP1 and SP2. In both cases, you need exclusive access - just as in all previous versions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks for the answers, where I get a documents of changes or corrections in VFP SP2?
 
In addition to the link that Mike Gagnon posted, you can find a list of bug fixes here:


As you can see, it's quite along. I noticed 12 items that mention indexes, although none of them seem to be directly related to your problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 

Mike,

I read also in this long list, but that are the bugs fixed is it not?
Under chapture Data:
It is possible to create structural index for a table opened in read-only mode, but it is not opened next time the table is opened.

That seems to be the case here I believe.

Koen
 
Coming late to the party,

you actually don't really have a problem, do you? As you create a newtable you can choose to delay the use (xtable) alias newcity. Just do it after you created all index tags.

Code:
xtable = "new" + sys (3)
select * from city into table (xtable)
index on cod_city tag cod_city
*...any further stuff needing exclusive access
use (xtable) alias newcity

I also don't think many developers were affected by this bugfix, if it really is what Koen found as security gap.

You always test against new versions before rolling them out, that also applies to SPs.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top