Hi all,
I have problems with CDX-indexes.
First of all I have a file INGREDIENT.DBF created with the DB-server
editor
of VO 2.6. In the DB-editor I defined the CDX-driver. Together with the
creation of the DBF-file, two indexes were created: Ing_IngNr.CDX and
Ing_Ingred.CDX. Ing_Ingr.DCX belongs to a numeric field called "IngrNr".
Ing_Ingred.CDX belongs to a character field called "Ingredient".
So far so good. Using and testing gave no problems. The indexes work fine,
can be opened and appending, editing and deleting data gives the normal
predictable results.
But....
When I want to build the indexes again with INDEX ON, or DBCreateIndex(),
the index file Ing_ingred.CDX cannot be used in a normal way anymore. It
looks like the other works wall, although I'm not completely sure of it.
I made sure that I delete the index files before building the index, like
I
read in this NG.
This is the (test)code:
Ctrl1:=FErase(confdefDir+"INg_IngNr.CDX")
Ctrl2:=FErase(confdefDir+"INg_Ingred.CDX")
DBUSEAREA(TRUE, "DBFCDX", "INGREDIENT",,TRUE)
DBCREATEINDEX("Ing_IngNr","INGRNR",{||INGREDIENT->INGRNR})
DBCREATEINDEX("Ing_Ingred","INGREDIENT",{||INGREDIENT->INGREDIENT})
INGREDIENT->DBCLOSEAREA()
In an empty datafile, created bij the DB-editor, the size of the
indexfiles
is as follows
Ing_IngNr.CDX 3072 bytes
Ing_Ingred.CDX 3072 bytes
Now, when I im****t records of a testdatabase the sizes are:
Ing_IngNr.CDX 5120 bytes
Ing_Ingred.CDX 10240 bytes
At this point everthing goes well, the indexes work as they should, no
problems occurred.
When I build the indexes again with the code as above the sizes are:
Ing_IngNr.CDX 5120 bytes
Ing_Ingred.CDX 7168 bytes
So there's a difference in filesize. After the building of the indexfiles
it
looks like there's less information in the indexfile. I cannot see why
there is a difference in those files of wrhy the indexes behave
differently.
Is the index corrupt or am I forgetting something?
Greetings
Bert Bonnemaijers


|