Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Invalid Index Descriptor

Posted on 2001-06-12
5
Medium Priority
?
1,714 Views
Last Modified: 2012-06-27

Why am I getting the "Invalid Index Descriptor" error when I try to create this DB at runtime?

I want to create a DBase table named Index.dbf with a maintained index called Index.mdx, indexing on Field 'Descr'.

var NewTable : TTable;
...
NewTable := TTable.Create(fPickDir); // fPickDir is current form
NewTable.Active := False;
NewTable.TableName := sDummy; // sDummy is path+'index.dbf'
NewTable.TableType := ttDBase;
NewTable.FieldDefs.Clear;
NewTable.FieldDefs.Add('DESCR', ftString, 50, False);
NewTable.FieldDefs.Add('FILENAME', ftString, 50, False);
NewTable.IndexDefs.Clear;
NewTable.IndexDefs.Add('Index','Descr',[ixExpression]);
NewTable.CreateTable;  // ** Error Happens Here
NewTable.Free;

Thanks in advance,
WKHays
0
Comment
Question by:wkhays
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Expert Comment

by:Phoenix_s
ID: 6183624
sounds like the BDE is having a fir because you names the index, INDEX.

try to change the index name to something like

IX_DESCR  which will make the index file IX_DESCR.MDX

if you have any other indexes you need set up, it might be an idea to adhere to a standard naming convention for all indexes utilizing IX_<field-indexed>

so that if there was a field called user which needed indexing, the index would be names IX_USER, which would then create a file called IX_USER.MDX.

hope this helps
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6185336
guessing the expression is missed in the index-definition
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6185340
try

NewTable.IndexDefs.Add('Index','Descr',[ixPrimary]);
0
 
LVL 17

Accepted Solution

by:
geobul earned 200 total points
ID: 6185712
Hi,

...
NewTable.IndexDefs.Clear;
NewTable.CreateTable;
NewTable.AddIndex('Index','Descr',[ixExpression]);
NewTable.Free;

Regards, Geo
0
 
LVL 4

Author Comment

by:wkhays
ID: 6188414
Thanks all:

Phoenix - I really want my index to be called index.mdx to match a file called index.dbf... There are already dozens of these in existence that were manually made ... To late to change the convention.

kretzschmar - According to the online help, [ixPrimary] is not valid for DBase files.

GeoBul - Works like a charm... Thanks!!!

-WKHays

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question