EasyTable: Single-File Embedded Database,
a BDE replacement for Delphi and C++Builder



Opening and closing a table
Previous  Top  Next


Introduction

After
setting up EasyTable component, just open the table to view and edit table's data in a data-aware control such as TDBGrid. There are two ways to open a table. You can set its Active property to True, or you can call its Open method. The following example shows how to use the Open method to open a table called 'customers' in existing database named 'NorthBase' with a TEasyTable component called MyEasyTable and TEasyDatabase component called MyEasyDatabase:

begin
//
database settings
with MyEasyDatabase do
begin
DatabaseFileName := 'c:\edb';
DatabaseName := 'NorthDatabase';
end;

// table settings
with MyEasyTable do
begin
DatabaseName:='NorthDatabase';
TableName:='customers';
ReadOnly:=False;
Open;
end;
end;

The ReadOnly property causes the current table with the name in the TableName property to be opened read-only, which means that the current application will be unable to modify the contents of the table until the table is closed and re-opened with write access (ReadOnly=False).

Also if you are dealing with very large table and want to reduce opening time and memory consumption you can set CacheEnabled property to False, but this also causes fall of searching and filtering speed.

There are two ways to close a table. You can set its Active property to False, or you can call its Close method. Active controls associated with the table's data source are cleared.
The following example shows how to use the Close method to close a table with a TEasyTable component called MyEasyTable:

begin
MyEasyTable.Close;
end;



© AidAim Software EasyTable: Easytable Single-file Embedded Database Bde Replacement Delphi C\+\+builde