Board index » delphi » "Invalid index/tag name" error

"Invalid index/tag name" error

Hi,

I have a program which creates a Paradox table at runtime.  It has been
working fine but, when I add a few lines of code to create a secondary
index, I always get the EDBEngineError "invalid index/tag name" and the
table isn't created.  This is my code...

      with AddIndexDef do
      begin
        Name := 'proj';
        Fields := 'Project';
        Options := [];
      end;

I have noticed that if I don't assign the name property, it works ok and the
index is automatically named "Project" but I need it to be named "proj".
Any ideas why this might be happening and how I can get round it?

Thanks a lot
Kate

 

Re:"Invalid index/tag name" error


I would use a query to create the index

with Query do
begin
  SQL.Clear;
  SQL.Add('create index project on your_table_name(project)'),
  ExecSQL;
end;

Quote
> I have a program which creates a Paradox table at runtime.  It has been
> working fine but, when I add a few lines of code to create a secondary
> index, I always get the EDBEngineError "invalid index/tag name" and the
> table isn't created.  This is my code...

>       with AddIndexDef do
>       begin
>         Name := 'proj';
>         Fields := 'Project';
>         Options := [];
>       end;

> I have noticed that if I don't assign the name property, it works ok and
the
> index is automatically named "Project" but I need it to be named "proj".
> Any ideas why this might be happening and how I can get round it?

Re:"Invalid index/tag name" error


Single field case sensitive secondary indices *must* have the same
name as the field.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Re:"Invalid index/tag name" error


Ok, thanks.  Setting options to [ixCaseInsensitive] has solved the problem.

Quote
"Bill Todd" <n...@no.com> wrote in message

news:7qhqhvs5p7vv8gv7dl85rcd6gj2l0ked79@4ax.com...
Quote
> Single field case sensitive secondary indices *must* have the same
> name as the field.

> --
> Bill (TeamB)
> (TeamB cannot respond to questions received via email)

Other Threads