Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
DatabaseDelphiTech Partner

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. 

  • Works with: Delphi, C++ Builder, VCL
  • Works on: Windows 32-bit, Windows 64-bit

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.

Clinic ER Diagram

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.

Access Primary Key GUID

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

  • coming to the clinic,
  • in-clinic waiting to see the doctor,
  • who have seen the doctor, and
  • who left.

Code Highlights

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

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

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.

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!

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Technical Director at Polywick Studio, a top-rated Upwork company. I have over 10+ years of experience using Delphi. I am a member of the Add-in-Express ADX Team,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worth reading...
RAD Studio Virtual Tour 2020

IN THE ARTICLES