Bert.
1. You must not mix clipper function calls with DBServer class object
use. Unfortunately there will be problems relating to workarea usage.
2. When you open a CDX based DBF the index of the same name is
automatically opened unless you suppress that. DO NOT reopen the index.
DO NOT open another index unless you really know what you are doing.
3. With CDX you generally only have one index with multiple orders.
Set the order you need, when you need it.
4. Done this way, the orders self-maintain.
Geoff
"Bert Bonnemaijers" <h.nospam.bonnemaijers.geenspam@[EMAIL PROTECTED]
>
wrote in message news:481a3387$0$24400$5fc3050@[EMAIL PROTECTED]
> Hello Dick,
>
> Bedankt voor je reactie!
>
> Everything I tried gives the same result:
>
> The very old Clipper-style:
> USE INGREDIENT VIA "DBFCDX" NEW
> INDEX ON INGREDIENT TO ING_INGRED
>
> The less old Clipper-style:
> IF DBUSEAREA(TRUE, "DBFCDX", "INGREDIENT",,TRUE)
> DBCREATEINDEX("Ing_Ingred",,{||INGREDIENT->INGREDIENT})
>
> The CreateOrder() way:
> LOCAL oIngredient AS Ingredient
> oIngredient:=Ingredient{}
> oIngredient:CreateOrder(,"Ing_IngNr","INGRNR")
> oIngredient:CreateOrder(,"Ing_Ingred","INGREDIENT")
>
> All these different approaches create a file called ING_INGRED.CDX with
a
> size of 7168 bytes.
>
> So I think the index itself is OK.
>
> So maybe it is something wrong in the way I call the server. I have a
> dataserver with a Postinit() in which I put the following lines:
>
> SELF:SetIndex("Ing_ingred")
> SELF:SetIndex("Ing_ingnr")
> SELF:SetOrder("Ing_ingred")
>
> Attaching the dataserver to a datawindow or datadialog gave the right
index
> and worked fine until I built the new indexes. After that the index
didn't
> work properly. (see my first post in this topic).
>
> If the index is created by the DB-editor all works fine, if the index is
> created by one of the index-commands of functions it doesn't work
properly.
> So I suppose it are two different kind of index-files, otherwise this
> problem wouldn't occur.
>
> If I drop the indexmodule, things will be working like I want them to,
but
> what happens if it is necessary to rebuild the indexes in case of
> powerfailure or something like that? Or is there no way the CDX-indexes
can
> get corrupt? Sorry, but I don't get it.
>
> Greetings,
>
> Bert Bonnemaijers
>
>
> "D.J.W. van Kooten" <public@[EMAIL PROTECTED]
> schreef in bericht
> news:6l6k145m97kqjmmcrvj1krp4vt3ftgsbbk@[EMAIL PROTECTED]
> > On Thu, 1 May 2008 21:00:09 +0200, "Bert Bonnemaijers"
> > <h.nospam.bonnemaijers.geenspam@[EMAIL PROTECTED]
> wrote:
> >
> > Hello Bert,
> >
> >>But from what I am reading now, I understand that it is possible to
> >>rebuild
> >>indexfiles from a dataserver attached to a datawindow? I didn't see a
> >>method
> >>in the datawindow or dataserver class to do that.
> >>
> >>Can you give me any clue?
> >>
> >
> > You mean something like:
> >
> > IF !odb:CreateOrder("uid",cCdx,"userid") // Create order 1
> > lSuccess:=FALSE
> > ENDIF
> > IF !odb:CreateOrder("relatie",cCdx,"relatie+userid")// Create order 2
> > lSuccess:=FALSE
> > ENDIF
> >
> > From the help file:
> >
> > <oDBServer>:CreateOrder(<cOrderName>, <oFSIndex> | <cIndex>, <cExpr>,
> > [<cbExpr>], [<lUnique>]) ---> lSuccess
> >
> >
> >
> > Dick van Kooten


|