IBX.InterBase ToGo Sample
This sample shows how to monitor trace flags on an InterBase database connection. It requires InterBase to be installed on the machine or to connect to a remote server. Make sure that the InterBase server is running before you run the example.
You can find the Monitor Demo project at:
- Start | Programs | Embarcadero RAD Studio Rio | Samples and then navigate to CPP\Database\IBX\InterBaseToGo.
- Subversion Repository for C++: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RADStudio_Rio/CPP/Database/IBX/InterBaseToGo/
This sample has two TStringGrid components. The grid on the top shows the content of the Customer table from the Employee database. The lower grid is related to the grid on the top, and it shows all the records from the Sales table associated with the selected customer.
This sample runs on Win32, Win64, and on Mac OSX versions starting with 10.9.
How to Use the Sample
- Navigate to the location given above and open:
- Press F9 or choose Run > Run.
- Select the Employee GDB check box to connect to the database.
- Use the navigators to go through the records of the grids.
|File in C++||Contains|
The project itself.
The main form and the code to give the functionality to the sample.
This sample uses a TIBDatabase component to connect to the EMPLOYEE.gdb database, which is available in the C:\Users\Public\Documents\Embarcadero\Studio\\Samples\Data directory.
The relations on the different database components are created using LiveBindings. Select View > LiveBindings Designer to open the LiveBindings Designer pane where you can see the bindings between the components. You can also see the relations in the TBindingsList component, this component is automatically added to the project once a relation using livebindings is created.
The Data.Bind.DBScope.TBindSourceDB is a nonvisual component that appears automatically after creating the binding.
Right-click the IBDataSet1 component and click Edit SQL to see the SQL query that the dataset is using to show the data. The IBDataSet2 creates the relation between the two tables with the SQL Query: "select * from sales where Cust_No = :Cust_No".