From Clomosy Docs
You will explore the fundamental commands used for database management in the TRObject programming language. Database applications provide many important functions to facilitate data access and management. Commands such as Open, Close, Insert, and Edit interact with data sets, enabling the reading, updating, and addition of new records. Additionally, navigation commands like First, Next, Last, and Prior allow for traversing through data sets and locating specific records. Comprehensive information about the commands you can use when performing database operations is provided.
Open
The result set obtained from a database query is used to open or prepare the data for use. The connection must be active before interacting with the database.
Clomosy.DBSQLServerQuery.Open; Clomosy.DBSQLiteQuery.Open; Query1.Open; // Query1 opens the database query.
OpenOrExecute
It is a method used to open or execute a database query. This method automatically opens the query if it is not already open; if it is open, it executes the query.
Clomosy.DBSQLServerQuery.OpenOrExecute; Clomosy.DBSQLiteQuery.OpenOrExecute; Query1.OpenOrExecute;
First
It is used to mark the first record in a dataset. This command allows you to navigate to the first record of the dataset when retrieving the query result.
Clomosy.DBSQLServerQuery.First; Clomosy.DBSQLiteQuery.First; Query1.First;
Next
It is used to move to the next record in a dataset. This command allows you to navigate to the record following the current record position.
Clomosy.DBSQLServerQuery.Next; Clomosy.DBSQLiteQuery.Next; Query1.Next;
Last
It is used to mark the last record in a dataset. This command allows you to navigate to the last record of the dataset when retrieving the query result.
Clomosy.DBSQLServerQuery.Last; Clomosy.DBSQLiteQuery.Last; Query1.Last;
Prior
It is used to move to the previous record in a dataset. This command allows you to navigate to the record preceding the current record position.
Clomosy.DBSQLServerQuery.Prior; Clomosy.DBSQLiteQuery.Prior; Query1.Prior;
Free
It allows an object to be freed from memory. When this command is used, all resources related to the object are released, and the object becomes unusable.
Clomosy.DBSQLServerQuery.Free; Clomosy.DBSQLiteQuery.Free; Query1.Free;
Close
It allows a database query to be closed. This command releases the dataset of an opened query and closes the connection.
Clomosy.DBSQLServerQuery.Close; Clomosy.DBSQLiteQuery.Close; Query1.Close;
Found
It is used to check whether the searched record exists when performing a search operation in a dataset. It returns `True` if there is a record in the result set of a query, and `False` if there is not.
if(Query1.Found);