Board index » delphi » Index file problem for DBase

Index file problem for DBase

How do you create multiple DBase index fields in Delphi 2.0? I can
create a single field with no problem, but when I try:

addindex(copytable.tablename, 'RIF30_;CSN_ZF', []);

I get an error reporting 'invalid index descriptor.  If I simply leave
out one of the field names, the index is created perfectly.

How do we get multiple fields in an MDX?

Thanks for ideas or experiences . . .

 

Re:Index file problem for DBase


Quote
Jeff Jones wrote:

> How do you create multiple DBase index fields in Delphi 2.0? I can
> create a single field with no problem, but when I try:

> addindex(copytable.tablename, 'RIF30_;CSN_ZF', []);

> I get an error reporting 'invalid index descriptor.  If I simply leave
> out one of the field names, the index is created perfectly.

> How do we get multiple fields in an MDX?

> Thanks for ideas or experiences . . .

I have the same problem too. Have you try that in other database
formats?

Re:Index file problem for DBase


In article <33E5E75C.5...@netvigator.com>, Tse Ming Wai
<mw...@netvigator.com> writes

Quote
>Jeff Jones wrote:

>> How do you create multiple DBase index fields in Delphi 2.0? I can
>> create a single field with no problem, but when I try:

>> addindex(copytable.tablename, 'RIF30_;CSN_ZF', []);

>> I get an error reporting 'invalid index descriptor.  If I simply leave
>> out one of the field names, the index is created perfectly.

>> How do we get multiple fields in an MDX?

>> Thanks for ideas or experiences . . .

>I have the same problem too. Have you try that in other database
>formats?

I think you have to use an expression eg:-
          MData.Daily.Exclusive := True;
          MData.Daily.Open;
          MData.Daily.AddIndex('COREF','CO_REF',[ixExpression]);
          MData.Daily.AddIndex('COUSR','CO_REF+USER',[ixExpression]);
          MData.Daily.AddIndex('DATE','DTOS(CALC_DT)',[ixExpression]);
          MData.Daily.Close;

Regards

Simon Riggs

Re:Index file problem for DBase


Quote
On Mon, 04 Aug 1997 05:46:02 -0400, Jeff Jones <ts...@cris.com> wrote:
>How do you create multiple DBase index fields in Delphi 2.0? I can
>create a single field with no problem, but when I try:

>addindex(copytable.tablename, 'RIF30_;CSN_ZF', []);

>I get an error reporting 'invalid index descriptor.  If I simply leave
>out one of the field names, the index is created perfectly.

>How do we get multiple fields in an MDX?

>Thanks for ideas or experiences . . .

dBASE indexes work differently from any other database indexes. You
need to create a valid dBASE index expression. In your case, simply
replace the semicolon with a plus. That should do it. There is a TI
document on Borland's site describing dBASE indexes.

Julian van Tubbergh.

Re:Index file problem for DBase


Jeff Jones <ts...@cris.com> wrote in article <33E5A4DA.4...@cris.com>...

Quote
> How do you create multiple DBase index fields in Delphi 2.0? I can
> create a single field with no problem, but when I try:

> addindex(copytable.tablename, 'RIF30_;CSN_ZF', []);

> I get an error reporting 'invalid index descriptor.  If I simply leave
> out one of the field names, the index is created perfectly.

> How do we get multiple fields in an MDX?

> Thanks for ideas or experiences . . .

Try using an expression index. I don't konw how to this programatically,
but you can do it using the Database desktop.

Other Threads