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

Error Index tag not found

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
AU
I have a puzzling occurence with one of my small apps. I wrote this years ago and have been asked to add another report to it. It runs using a single screen and is a membership database for a ex-servicemens club.

I have used SET ORDER TO TAG SURNAME in a prg file which runs before creating a report. The table MEMBERS is already selected.

When I run the app in my develoment folder I get the required output report correctly ordered (from a prg run from a command button on the app's main form )

However I have copied all the required files to another test folder on my PC and when doing the above on the main form I get the error

'index tag not found'

I have reindexed the members table in which I see the fields marked as having indexes set in the cdx file using display status in the debugger.

Can someone help me out here please?

Gendev
 
I'd DELETE TAG ALL and then INDEX ON to recreate indexes. If a tag is somehow "wired" wrong, not known by that tag name, that doesn't get repaired by REINDEX.

That said, you should of course not only look, whether fields have index checked, look into tag names of the indexes. they not necessarily match field names.

Bye, Olaf.
 
The whole code works in the development folder and the Display Status shows the cdx index uses the field names so that's not the problem.
Thanks

GenDev
 
Well, something must be the reason for the error "Index tag not found".
You may not have selected the table when you SET ORDER. Either that, or the index doesn't have the tag name, I can't think of a third reason.

Bye, Olaf.
 
Sorry if this is stating the obvious, but are you sure you copied the up-to-date version of the CDX file after you created the index tag? If the CDX in the "other test folder" didn't have the tag in question, that would explain the error. I know it's unlikely you would have forgotten that, but I can't think of any other explanation.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
However I have copied all the required files to another test folder on my PC and when doing the above on the main form I get the error

You just explained your own problem here.

1. Things work.
2. Copy files.
3. Things don't work.

What's the one thing that happened here? The copy. Something didn't properly make the trip. Either that or you're leaving out some details.
 
I copied the user's app folder to my PC using TV and my new exe ran OK. So I copied my new exe to the users app folder - all Ok there too. I have not been able to identify the difference in his app folder to the one on my PC I was having trouble with.

Thanks to all

Gendev
 
The question isn't about copying the EXE, but about copying the CDX file. This is the one that contains the index tags (for the relevant table). The point is that if the CDX file is present but is out of date (that is, it doesn't contain the new tag), that would explain the error you saw.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike,

The dbf and cdx were identical and I checked with Display status as I said.

Regards

Gendev
 
Well,

Display Status lists info on:
Active indexes
Index file keys
The controlling index file or tag
Open structural compound files
Open compound index tags

But it doesn't list ALL indexes, does it?
ATagInfo() would give that info.
> dbf and cdx were identica
What did you compare? File date? What about file size? You could have had an incomplete copy.

Bye, Olaf.



 
I verified, display status indeed lists all indexes of a cdx and lists the currently activa as master index.

If I try to SET ORDER to a non existent tag name, I don't get error "index tag is not found", though, but Variable 'tagname' does not exist. So you have to find out what command is causing that error. Don't you have a reference to the line and program causing the error? Still no error handler present, that logs LINENO, PROGRAM and AERROR info?

The problem most probably was not setting the order, but using the index. Perhaps the tag info was in your CDX header, but the index tag itself was not in the body of the file, eg the cdx file was incomplete.
Windows Explorer displays a file with full size while still copying, for example. It already displays the future size after finishing copy, so even that info can be misleading.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top