Subject Searching within a TIB_Query using Locate?
Author Chris at Visible Changes
I am using a simple "SELECT * FROM TABLE_JOBCLASS ORDER BY NAME" command
within my SQL property to populate the TIB_Query control. But I wish to
move my cursor to the row based on a value entered by the user in my
application. The value is a simple integer for a field named ID within the
Table named TABLE_JOBCLASS. I am using the Locate command and all I get is
errors. When I take out the ORDER BY NAME clause the Locate command appears
to move the cursor to the appropriate record but still gets an error
afterward. This table only has two indexes ID and NAME. I would like to
move the cursor based on the ID value entered by the user but maintain the
order by NAME. What am I doing wrong and any help would be greatly
appreciated. I have some sample code of how I am doing this in C++
Builder?


TIB_Query *Table_JobClass; // Previous Represented by TTable

void __fastcall TForm_JobClass::Button_SearchClick(TObject *Sender)
{
TIB_LocateOptions Search_Options;

// Users Enters Value for ID field - Search_Select
if (SearchForRecords()) // Returns ID integer Search_Select
{
Table_JobClass->Locate("ID",Search_Select,Search_Options);
}
}


Chris Hulsey
Visible Changes, Inc.
chulsey@...