Subject RE: [IBO] TIB_Quert property Ordering Items
Author Mike Hickman
Tnks for prompt reply.
Placed "sqlLookBook.SQLOrder.add('BookRef');"
in OnPrepareSql event.
Then code the following in a to button to implement the reqired action :

sqlLookBook.Unprepare;
sqlLookBook.prepare;
sqlLookBook.open;
LookBook.Execute ;

Where sqlLookBook is the query and Lookbook is a TIB_Lookup dialog with its
Lookupdataset value being sqlLookBook

Lookbook has an unsorted result if the order is set at run time with the
onbeforeprepare event handler, but is sorted if the Order By is hard coded
in the sql property of sqllookbook.
Why isnt the onbeforeprepare handler being called(or actioned )?





-----Original Message-----
From: Geoff Worboys [mailto:geoff@...]
Sent: Saturday, 3 March 2001 5:24 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] TIB_Quert property Ordering Items


> I then delete the Order By Bookref stastement then I follow
> Jasons suggestion and enter the following code in the
> Beforeprepare event
>
> "sqlLookBook.SQLOrder.add('BookRef');"

I believe this should go in the OnPrepareSQL handler - Similar to the
example of adding SQLWhereItems in the Contact sample application.


> What am I missing ?
> Should I be setting the OrderingItems,OrderItemNo or
> OrderingLinks properties ?

If the requirements for these properties can be determined at
designtime, then the Ordering* properties are certainly the easier way
of managing and changing Order.

SQLWhereItems, SQLOrder etc should really only be necessary for items
that can only be determined at runtime.

HTH

Geoff Worboys
Telesis Computing





Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/