Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index Problems
Message
From
17/11/2005 09:58:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Stonefield
Title:
Index Problems
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01069761
Message ID:
01069761
Views:
59
When I look at index expression for the tag re_tag in the dbc in Stonefield Database Explorer the index expression is:

DTOC(P_DATE)+PADL(STR(PO_INSCO),3)+PO_NAME

It appears to be correct both by scrolling down through the table's field and indices and viewing the properties for tag in the right window and also by right-clicking on the table and selecting modify table, and then clicking on the index tag and viewing the tag there.

However, when I run:

oMeta.SetDatabase('dbcWorkFiles')
oMeta.SDTMgr.Reindex('ALL')

I can see it reindex the table and I can see the index displayed correctly (by opening the table afterwards and looking at sys(14) for the tag re_tag). The tag appears to exist as it should.

However, if I attempt to append records, I receive the error message below:

Error building key for index "c:\profiler\data\ivans_h.cdx" tag "Re_tag".

Following that, if I manually reindex the table via the command window by issuing:

USE ivans_h exclu
INDEX on DTOC(P_DATE)+PADL(STR(PO_INSCO),3)+PO_NAME TAG re_tag
APPEND BLANK

There are no errors and the tag exists as it should.

If I delete the table and cdx completely and let SDT recreate it, again the tag appears to exist using sys(14) and display status, but I receive the error again and have to manually create the tag in the command window for it to work correctly.

Additional Note: I just tested viewing the table's fields and indices in Stonefield Database Explorer and if I scroll down to the table's index and right click on the index and choose reindex from the popup, then it reindexes correctly and I do not receive the error. Since that works, why doesn't the update tables method and also forcing the reindex programmatically using reindex() method work?

*!!New Update:
Surprisingly, if I issue the commands below in a program in my app after Stonefield creates the table on the fly, it does NOT work. I see the indices correctly, but I receive the error when I attempt to add a record:

SELE IVANS_H
DELETE TAG RE_TAG
DELETE TAG RE_TAGC
DELETE TAG RE_TAGN
INDEX ON DTOC(P_DATE)+PADL(STR(PO_INSCO),3)+PO_NAME TAG re_tag
INDEX ON PADL(ALLTRIM(STR(PO_INSCO)),3)+DTOC(P_DATE)+PO_NAME TAG re_tagc
INDEX ON PADL(ALLTRIM(STR(PO_INSCO)),3)+PO_NAME+DTOC(P_DATE) TAG re_tagn

However, if I exit the program, go to the command window, I can see the tags but I cannot append. I receive the error. However if I then immediately issue the exact same commands listed above (either delete the tag and recreate the tags from scratch or just even issue the keyword reindex) from the command window, it works. I can then append to the table.

??? Very strange. What is different between the command window and the program environment would affect the indexing?
ANSI, COLLATE?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform