Get the App
SLTechnology News&Howtos  ›  Database  › 

UniDAC usage tutorial (3): master-slave relationship

Shulou Source: shulou.com Published: 2022-06-01 18:22:25 10月05日 Update

Download the latest version of UniDAC

Universal Data Access Components (UniDAC) is a general database access component that provides direct access to multiple databases, such as Delphi, C++Builder, Lazarus (and Free Pascal), Mac OS X, iOS, Android, Linux and 64 and 32-bit FreeBSD for Windows. We will focus our long-term experience on this widget to provide unified database connection access (such as oracle, Microsoft SQL, etc.). This means that you can easily switch different databases between your projects and create cross-database application interfaces.

The master / detail (MD) relationship between the two tables is extensive. Therefore, it is important to provide a simple way for database application developers to use it. Let's look at how UniDAC implements this feature.

Suppose we have a typical MD relationship between the "Department" and "Employee" tables.

There is a field Dept_No in the Department table. Dept_No is the primary key.

The "Employee" table has a primary key EmpNo and a foreign key Dept_No that binds "Employee" to "Department".

These tables must be displayed and edited.

UniDAC provides two ways to bind tables. The first code example shows how to bind two TCustomUniDataSet components to a MD relationship through parameters.

one

Tags: Data database between components two applications methods programs applications different important people code typical parameters multiple fields meaning interfaces to make Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information vpn Microsoft macOS