Solved

Invalid Index Descriptor

Posted on 2001-06-12
5
1,684 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 50 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month6 days, 6 hours left to enroll

626 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