Subject | Searching within a TIB_Query? |
---|---|
Author | Chris at Visible Changes |
Post date | 2000-12-11T17:28:53Z |
I am attempting to convert from the Borlands TTable to TIB_Query because of
a problem with arrays from within Interbase Database working with the BDE.
I am using a simple "SELECT * FROM TABLE_JOBCLASS" command to populate the
TIB_Query. 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. How do I do this with IBO
and I have some sample code of how I did this with TTable in C++ Builder?
TIB_Query *Table_JobClass; // Previous Represented by TTable
void __fastcall TForm_JobClass::Button_SearchClick(TObject *Sender)
{
AnsiString SaveKey;
if (SearchForRecords()) // User Enters Value for ID field
{
Table_JobClass->Cancel();
SaveKey = Table_JobClass->IndexFieldNames; // NOT SUPPORTED
Table_JobClass->IndexFieldNames = "ID"; // NOT SUPPORTED
Table_JobClass->EditKey(); // NOT
SUPPORTED
Table_JobClass->FieldByName("ID")->AsInteger = Search_ID; // Value ID
from User
Table_JobClass->GotoKey(); // NOT SUPPORTED
Table_JobClass->IndexFieldNames = SaveKey; // NOT SUPPORTED
}
}
Any help would be greatly appreciated. I am sure that there is a better way
to search and move the cursor to the desired record with TIB_Query but I am
a little new to the IBO game.
Chris Hulsey
Visible Changes, Inc.
chulsey@...
a problem with arrays from within Interbase Database working with the BDE.
I am using a simple "SELECT * FROM TABLE_JOBCLASS" command to populate the
TIB_Query. 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. How do I do this with IBO
and I have some sample code of how I did this with TTable in C++ Builder?
TIB_Query *Table_JobClass; // Previous Represented by TTable
void __fastcall TForm_JobClass::Button_SearchClick(TObject *Sender)
{
AnsiString SaveKey;
if (SearchForRecords()) // User Enters Value for ID field
{
Table_JobClass->Cancel();
SaveKey = Table_JobClass->IndexFieldNames; // NOT SUPPORTED
Table_JobClass->IndexFieldNames = "ID"; // NOT SUPPORTED
Table_JobClass->EditKey(); // NOT
SUPPORTED
Table_JobClass->FieldByName("ID")->AsInteger = Search_ID; // Value ID
from User
Table_JobClass->GotoKey(); // NOT SUPPORTED
Table_JobClass->IndexFieldNames = SaveKey; // NOT SUPPORTED
}
}
Any help would be greatly appreciated. I am sure that there is a better way
to search and move the cursor to the desired record with TIB_Query but I am
a little new to the IBO game.
Chris Hulsey
Visible Changes, Inc.
chulsey@...