Board index » off-topic » AddIndex()

AddIndex()


2003-11-21 07:34:43 AM
off-topic1
Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp me please!!!!!!!!!!!
why cannot I create an index with mult fields via database desktop to a
DBFIII and I cannot do the same at run time? What am I doing wrong?
here is what I am trying to do: CDRTable.AddIndex('CDRDate.NDX',
'DATE;COUNTRY;ORIGIN', [ixExpression]);
Thanks.
Jonas
 
 

Re:AddIndex()

You are the best Bill! Thanks a lot!!!
Jonas
"Bill Todd" < XXXX@XXXXX.COM >wrote in message
Quote
See community.borland.com/article/0,1410,15868,00.html


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

Re:AddIndex()

Hey guys!
I did as in Borland documentation 'dBASE Expression Indexes: A Primer - by
Borland Developer Support Staff Technical Information Database'
but i an getting the error message: 'Index does not exist. File:
D:\Applic\Nuera\Data\CDR.MDX'
here is my code:
with CDRTable do begin
DatabaseName := sPath;
TableName := 'CDR';
TableType := ttdBASE;
AddIndex('CDRDate', 'DATE + COUNTRY + ORIGIN', [ixExpression]);
end;
What ma I doing wrong? Thanks.
Jonas
"Jonas" < XXXX@XXXXX.COM >wrote in message
Quote
Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp me please!!!!!!!!!!!

why cannot I create an index with mult fields via database desktop to a
DBFIII and I cannot do the same at run time? What am I doing wrong?

here is what I am trying to do: CDRTable.AddIndex('CDRDate.NDX',
'DATE;COUNTRY;ORIGIN', [ixExpression]);

Thanks.

Jonas


 

{smallsort}

Re:AddIndex()

"Jonas" < XXXX@XXXXX.COM >wrote:
Quote
but i an getting the error message: 'Index does not exist. File:
D:\Applic\Nuera\Data\CDR.MDX'
It seems like the BDE is trying to upgrade your table to a
dBASE 4 table, and create a dBASE4-type .MDX multiple index
file rather than an .NDX file. If you don't need to keep the
file in the dBASE III format, you may want to just upgrade it
in Database Desktop and let it work with the .MDX file, since
the BDE seems to work better with those indexes. If you need
to have an .NDX index and a dBASE 3 table, I suppose you could
try setting your DBASE table level to 3 in the BDE Administrator
and see if that helps.
Please post your question once, rather than starting multiple
message threads!
Rick Carter
XXXX@XXXXX.COM
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group
 

Re:AddIndex()

No, I don't mind using .MDX.
I have found the problem but I don't know how to solve it at runtime.
Here is what I found: At runtime my application created the CDR.MDX file. I
delete that file, and run my application to recreate the same file
"CDR.MDX", but it gives me the message "Index does not exist. File:
D:\Applic\Nuera\Data\CDR.MDX", then I opened the .DBF file and saved the
structure again and I was able to regenerate the .MDX file. My questing is:
How can I remove the index at runtime? Thanks.
Jonas
"
"Rick Carter" < XXXX@XXXXX.COM >wrote in message
Quote

"Jonas" < XXXX@XXXXX.COM >wrote:
>but i an getting the error message: 'Index does not exist. File:
>D:\Applic\Nuera\Data\CDR.MDX'

It seems like the BDE is trying to upgrade your table to a
dBASE 4 table, and create a dBASE4-type .MDX multiple index
file rather than an .NDX file. If you don't need to keep the
file in the dBASE III format, you may want to just upgrade it
in Database Desktop and let it work with the .MDX file, since
the BDE seems to work better with those indexes. If you need
to have an .NDX index and a dBASE 3 table, I suppose you could
try setting your DBASE table level to 3 in the BDE Administrator
and see if that helps.

Please post your question once, rather than starting multiple
message threads!

Rick Carter
XXXX@XXXXX.COM
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group

 

Re:AddIndex()

"Jonas" < XXXX@XXXXX.COM >wrote:
Quote
Here is what I found: At runtime my application created the CDR.MDX file. I
delete that file, and run my application to recreate the same file
"CDR.MDX", but it gives me the message "Index does not exist. File:
D:\Applic\Nuera\Data\CDR.MDX", then I opened the .DBF file and saved the
structure again and I was able to regenerate the .MDX file. My questing is:
How can I remove the index at runtime? Thanks.
The problem is that the header of the dBASE .dbf file is rewritten
to flag that an index is present, or not. That's why you don't
want to delete the index directly. If you have exclusive access
to the table, you should be able to use TTable.DeleteIndex.
Rick Carter
XXXX@XXXXX.COM
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group