wkhays
asked on
Invalid Index Descriptor
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('DE
NewTable.FieldDefs.Add('FI
NewTable.IndexDefs.Clear;
NewTable.IndexDefs.Add('In
NewTable.CreateTable; // ** Error Happens Here
NewTable.Free;
Thanks in advance,
WKHays
guessing the expression is missed in the index-definition
try
NewTable.IndexDefs.Add('In dex','Desc r',[ixPrim ary]);
NewTable.IndexDefs.Add('In
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
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