main logo
Subject: Re: Views and order
Author: Pamela Thalacker
Posted: 2002/06/14 10:38:35
 
View Entire Thread
New Search


Hi Miguel,

<i><font color="#663300">I have a view of Customer table, that I use in a form to navigate through the records. Initially it's ordered by .cName. but I want to change the order field to be able to navigate the view ordered by a CustomerCode (not the iID). Is it possible to change the order in the same form?</font></i>

You can create an index on a view and use it to change the order of that view. The index is created in memory just like the view and disappears when the view is closed. The view must be using row buffering when you create the index so I usually use code something like this in aDataEnv:

FUNCTION Init
llRetVal = DoDefault()
llRetVal = llRetVal and This.CreateIndices()
ENDFUNC

FUNCTION CreateIndices
LOCAL lnOldWA
lnOldWA = SELECT(0)
SELECT vCustomer
CURSORSETPROP('Buffering',DB_BUFOPTRECORD)
INDEX ON CustomerCode TAG CusCode
CURSORSETPROP('Buffering',DB_BUFOPTTABLE)
Select(lnOldWA)
ENDFUNC

Pamela
pamela .at. eagle-crest D.OT com
 
©2002 Pamela Thalacker
<-- Prior Message New Search Next Message -->