#1  
Old 30th July 2012, 10:47 PM
Steve_A Steve_A is offline
Junior Member
 
Join Date: Jul 2011
Posts: 5
Default Help with adding an additional index

Would someone please help me with adding an index to an existing file using the DataDictionary components. I have no problem adding data fields and restructuring the file, but have not been able to get the index add function to work.

My problem is this:
The file I am trying to update is called 'InvRcvd'. It already has two indicies in addition to Seq. Access. I want to check to see if an index called 'RcptID' is present and if not I want to add it. The index consists of a single string field 'ReceiptID'.

Any help would be much appreciated.
  #2  
Old 30th July 2012, 11:26 PM
Bert Binnenmarsch
 
Posts: n/a
Default Re: Help with adding an additional index

Steve_A wrote:

Hi Steve,

I guess you are using the restructuring code that is posted somewhere
on the Nexus website.
Use the following as step 1 to determine if the index needs to be added:

AddIndex := Dict.IndicesDescriptor.GetIndexFromName('MyIndex') = -1;

Step 2, when NewDict has been created:

with NewDict.EnsureIndicesDescriptor do
with AddIndex('MyIndex', 0, idAll), KeyDescriptor as
TnxCompKeyDescriptor do
with Add(NewDict.FieldsDescriptor.GetFieldFromName('MyF ield'),
TnxTextKeyFieldDescriptor) as TnxTextKeyFieldDescriptor do
IgnoreCase := True;

Bert
  #3  
Old 31st July 2012, 12:36 AM
Steve_A Steve_A is offline
Junior Member
 
Join Date: Jul 2011
Posts: 5
Default

Thank you very much. It worked perfectly.

Steve


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Sequential Access Index Luke Johnston nexusdb.public.support 2 12th October 2007 06:38 AM
Adding Index Andrew Sowerby nexusdb.public.support 1 14th February 2007 10:08 PM
error adding an index Daniele nexusdb.public.support 0 10th August 2006 11:49 PM
Does adding a new index reload all the data into the table? Brent nexusdb.public.discussions 12 1st June 2006 10:25 AM
EM 3 - Error adding index Roy Granich nexusdb.public.support 13 13th July 2003 07:26 PM


All times are GMT +11. The time now is 02:57 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.