Subject |
Re: Indexing issue |
From |
Ken Mayer <dbase@nospam.goldenstag.net> |
Date |
Tue, 14 Nov 2023 09:57:33 -0800 |
Newsgroups |
dbase.getting-started |
On 11/14/2023 9:47 AM, Tom wrote:
> I am having an illegal key issue on my reindexing.wfm file. The first line works fine, but the other 2 give me an illegal key on the field initial.
>
> index on initial tag except for deleted() = false .and. exceptions = "X"
> form.text4.text ='Reindexing Address File - "Bill From"'
> index on initial tag lessee for deleted() = false .and. bill_from = "X"
> form.text4.text ='Reindexing Address File - "Bill To"'
> index on initial tag lessor for deleted() = false .and. bill_to = "X"
Tom, if you clean out your data a bit (pack the tables to get rid of
deleted records, for example) then the use of deleted() in an index
isn't necessary. You can also leave the dots off the word "and" --
that's DOS code ...
If you are having an issue with the field name I'd make sure the table
is open, which it should be ... Actually, now that I think on it, it may
be that the first index is causing problems. When you issue the INDEX ON
command, dBASE is now using that index tag. You may want to use CLOSE
INDEXES after each of your INDEX ON commands ... the first index may be
causing you difficulties. You can check by doing something like:
index on initial tag except for deleted() = false .and. exceptions
= "X"
? count()
And see what the row count is what the active index ... if it is zero,
then the error makes sense on the next "index on" because it can't find
any records. By using CLOSE INDEXES after doing the INDEX ON it ensures
that the most recent index is not active.
Ken
--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm
|
|