Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Easy Access Development Using Winsoft’s Adonis

Easily use ADO Compatible databases in Delphi using Winsofts Adonis

Access (“MS-Access”) is a popular desktop database for Microsoft Windows. It ranks among the top-10 databases on DB-Engines, and widely used in many Fortune-500 companies. Vendors, such as Hallam-ICS and QNE (Malaysia, Philippines) create business applications that use back-end Microsoft Access.

Winsoft Adonis is a component library for accessing databases which support the ADO programming model. All mainstream databases, such as MySQL, Embarcadero Interbase and  FileMaker provide either ODBC or ADO connectivity drivers for Windows. 


In this article, I created a small demonstration using Winsoft’s Adonis component library for connecting with Access.

Windows EXEs cannot run on Android, iOS, macOS or Linux. For that, you will have to use Delphi’s cross-platform FMX to target iOS, Android, macOS and Linux.

Installation is instantaneous, takes less than a minute and installs to Delphi’s component palette.

Clinic ER (Entity Relation) Diagram

In this demo, I am going to create a Delphi VCL application that connects to an Access Database for a small clinic. The basis of the VCL application for this demo is the simple CRM demo included with Delphi 10.4 and C++Builder 10.4. The source code for the demo is linked at the end of the post.

In a clinic, there are three kinds of appointments: walk-in appointments, booked appointments (“I’ll be coming at 4pm on Thursday”), and ER. A booked appointment is only for one clinic. A patient cannot be in two clinics at the same time. At the time of the appointment, the patient sees one (or more) doctors at any one time, and tells his problems. The one (or more) doctors seeing the patients diagnoses and writes a prescription, gives it to the patient. 

For brevity, hospital bedside visitations, doctor’s house-calls, pharmacy, dispensary, clinical health-education and consultation fees are left out.

Database Design

In this Clinic database, each table uses GUID for the primary key. This ensures that if you use the same database on two different computers and want to merge records, each row is unique and can easily be merged using JRO.

If you use auto-number or auto-increment, be aware you may end-up with the same primary keys and different data, making replication and de-duplication harder.

Clinic CRM

I converted Delphi Clinic CRM to use Winsoft’s Adonis. In this tutorial, I used Delphi 10.4 Update Patch 3.

The Patient Tab was re-factored to use Winsoft’s Adonis. The code-behind is minimal. It uses a TDataGrid connected to TWADODataSet.

Patient Table Table integrated using Winsoft’s Adonis
Winsoft TWADODataSet component directly accessing MS Access Tables

In order to ensure unique names, the names field is split into four fields – First Name, Middle Name, Last Name and Suffix. This ensures, when you enter a name, you won’t address your letter to the senior person, when you refer to the junior person.

The Clinic section shows the process of patients

Code Highlights

The GUID for the each new record is initialized in the NewRecord event.

[crayon-67427558470a2716274578/]

Before loading data, the grid redraw operation is temporarily paused using BeginUpdate and resumed using EndUpdate.

[crayon-67427558470b2503158752/]

After a page-control update, such as a tab-change, I use the PageIndex property to ensure initial settings are fired in the PageControlUpdate event.

[crayon-67427558470b6072748982/]

The code for this Clinic CRM demo can be downloaded here.

Head over and check out the full WINSOFT Adonis library for Access in Delphi and C++Builder.

Like what you see? You can get Adonis and over 100 other fantastic WinSoft components with our Enterprise Component Pack. For a limited time, when you purchase RAD Studio Enterprise or Architect Edition at special Upgrade Pricing, you will also get this package of third-party software worth over $13,000, including the full WinSoft Component Library, at NO EXTRA COST! Step up to RAD Studio 10.4 today!

Exit mobile version