Board index » delphi » TTable.AddIndex creates MDX for FoxPro table (!?)

TTable.AddIndex creates MDX for FoxPro table (!?)

Using Delphi 3.02, BDE 4.51, database with native FoxPro driver.
Problem is with the TTable.Addindex method: it seems to default to the
dbase MDX index-type instead of the FoxPro CDX index-type.

If the index already exists (CDX), then Delphi/BDE adds indexes (tags)
to the CDX file.

If none exists, then Delphi/BDE creates an MDX file!  This looks like a
bug to me.

I'm seeking a workaround.  I've tried some that don't work.  For
example, if I try to set the indexname property when the cdx doesn't
exist (to try to force the CDX index type), I get a file does not exist
error (because the MyTABLE.CDX doesn't exist).

Thanks in advance if you can advise how to deal with this...  and I
would *greatly* prefer *not* to have to learn the dbi functions, which
require a lot of weird and difficult-to-use parameters.  The routine I
have using GETINDEXNAMES, DELETEINDEX, and ADDINDEX already works great
except that - it doesn't work <grin>.

 

Re:TTable.AddIndex creates MDX for FoxPro table (!?)


Quote
Richard Grossman wrote:

> Using Delphi 3.02, BDE 4.51, database with native FoxPro driver.
> Problem is with the TTable.Addindex method: it seems to default to the
> dbase MDX index-type instead of the FoxPro CDX index-type.

> If the index already exists (CDX), then Delphi/BDE adds indexes (tags)
> to the CDX file.

> If none exists, then Delphi/BDE creates an MDX file!  This looks like a
> bug to me.

> I'm seeking a workaround.  I've tried some that don't work.  For
> example, if I try to set the indexname property when the cdx doesn't
> exist (to try to force the CDX index type), I get a file does not exist
> error (because the MyTABLE.CDX doesn't exist).

> Thanks in advance if you can advise how to deal with this...  and I
> would *greatly* prefer *not* to have to learn the dbi functions, which
> require a lot of weird and difficult-to-use parameters.  The routine I
> have using GETINDEXNAMES, DELETEINDEX, and ADDINDEX already works great
> except that - it doesn't work <grin>.

Hello,
  Use DbiAddIndex instead. Delphi 3 was not designed to handle creation
of FoxPro tables and indexes.  Look at:
http://www.inprise.com/devsupport/bde/bdeapiex/dbiaddindex.html
--
BDE Support:
 http://www.inprise.com/devsupport/bde
Delphi Support:
 http://www.inprise.com/devsupport/delphi
Common Delphi and BDE Questions and Answers:
 http://www.inprise.com/devsupport/delphi/qanda/

Re:TTable.AddIndex creates MDX for FoxPro table (!?)


Can we create index for interbase table in Delphi 3?

Thanks

Scott Frolich [Inprise] <sfrol...@corp.inprise.com> wrote in article
<358EAC91.6...@corp.inprise.com>...

Quote
> Richard Grossman wrote:

> > Using Delphi 3.02, BDE 4.51, database with native FoxPro driver.
> > Problem is with the TTable.Addindex method: it seems to default to the
> > dbase MDX index-type instead of the FoxPro CDX index-type.

> > If the index already exists (CDX), then Delphi/BDE adds indexes (tags)
> > to the CDX file.

> > If none exists, then Delphi/BDE creates an MDX file!  This looks like a
> > bug to me.

> > I'm seeking a workaround.  I've tried some that don't work.  For
> > example, if I try to set the indexname property when the cdx doesn't
> > exist (to try to force the CDX index type), I get a file does not exist
> > error (because the MyTABLE.CDX doesn't exist).

> > Thanks in advance if you can advise how to deal with this...  and I
> > would *greatly* prefer *not* to have to learn the dbi functions, which
> > require a lot of weird and difficult-to-use parameters.  The routine I
> > have using GETINDEXNAMES, DELETEINDEX, and ADDINDEX already works great
> > except that - it doesn't work <grin>.
> Hello,
>   Use DbiAddIndex instead. Delphi 3 was not designed to handle creation
> of FoxPro tables and indexes.  Look at:
> http://www.inprise.com/devsupport/bde/bdeapiex/dbiaddindex.html
> --
> BDE Support:
>  http://www.inprise.com/devsupport/bde
> Delphi Support:
>  http://www.inprise.com/devsupport/delphi
> Common Delphi and BDE Questions and Answers:
>  http://www.inprise.com/devsupport/delphi/qanda/

Other Threads