![Page 1: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/1.jpg)
Developing Win32 Database Applications with DelphiCary Jensen
Jensen Data Systems, Inc.
![Page 2: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/2.jpg)
Overview
General Comments About Delphi’s Data Access Technologies
Overview of Data Access Technologies The Borland Database Engine dbExpress dbGo (ADO) MyBase InterBase Express DataSnap Third-Party Data Access Options
Data Modules Data Aware Controls Programming with Data Providers
![Page 3: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/3.jpg)
TDataSet
The Origins Paradox, the Paradox Engine, ODAPI, IDAPI, IDAPI, BDE
The Legacy A navigational interface in a largely set-based world
Things changed with Delphi 3
![Page 4: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/4.jpg)
DelphiC++
BuilderData
GatewayVisualdBASE
Borland Database Engine (BDE)
Local TablesParadox, dBASE,
Access, FoxPro
Remote TablesOracle, Sybase,
MS SQL Server, ...
ODBC-readydatabases
SQL Links
TCP/IP, SPX/IPX, NetBEUI ODBC Driver
ODBC Socket
![Page 5: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/5.jpg)
Session (default)
Database (default)
DataSets (Table,Query, StoredProc)
DataSource
Data Controls (DBGRid, etc.)
BDE
![Page 6: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/6.jpg)
BDE Advantages
If you already have it installed and working for existing applications, new applications require little or no configuration to use it
Many legacy applications exist which use it Two or more applications written in Delphi can easily
share global aliases It has relatively good performance across a large
number of data types It provides access to installed ODBC drivers
![Page 7: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/7.jpg)
BDE Limitations
In the typically deployment of BDE-based applications, a copy of the BDE must be installed and configured on each workstation (a network installation is possible, but requires manual registry configuration)
The BDE is somewhat inefficient, in that it stores as many as three copies of table metadata
When used with local tables such as Paradox tables, failure to correctly configure the BDE can produce periodic index corruption
If a new BDE application is incorrectly installed, existing BDE applications may fail to initialize properly
The BDE is available only for the Windows platform
![Page 8: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/8.jpg)
Vendor Library
Database
Delphi’s dbExpress
Components
dbExpress Driver
dbExpress
![Page 9: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/9.jpg)
SQLConnection
DataSource
ClientDataSet
DataSetProvider
SQLClientDataSet
Unidirectional DataSets
Data Aware Controls
dbExpress
![Page 10: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/10.jpg)
dbExpress Advantages
Data-related operations in dbExpress tend to be faster than using other technologies
dbExpress-based applications can be deployed under both Windows and Linux environments
Applications designed to use dbExpress can more easily be ported to using DataSnap
dbExpress applications require fewer support files and can require far less configuration than BDE applications
![Page 11: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/11.jpg)
dbExpress Limitations
dbExpress applications are generally more complicated than other types of Delphi database applications to program. In addition to requiring more components to access and edit data, dbExpress applications often require more lines of code than non-dbExpress applications
There are relatively few dbExpress drivers available
![Page 12: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/12.jpg)
ActiveX
OLE DB Provider
Data
Delphi ADO Datasets
Microsoft Universal Data Access (MDAC)
Data Access Components
Plugable Layer
Data (database,spreadsheet, document, etc.)
![Page 13: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/13.jpg)
TDataSet Descendants
DataSource
Data Aware Controls
TADOCommand
TADOConnection
ActiveX Data Objects
![Page 14: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/14.jpg)
ADO Advantages
All Windows-based computers shipped in the past few years already have MDAC installed. As a result, most ADO-based applications require only the installation of the specific OLE DB provider, at most
ADO can be used from a wide range of development environments, including MS Access, VisualBasic, Delphi, Visual C++, to name of few
A wide range of OLE DB providers are available Applications that have been deployed as COM+ applications (formerly
referred to Microsoft Transaction Server components), can pool ADO connections, producing improved performance in environments that require large numbers of independent requests for data, such as Web server extensions
![Page 15: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/15.jpg)
ADO Limitations
ADO is available only for the 32-bit Windows operating system Having MDAC installed and configured is not enough. In some cases, you
must also install and register an appropriate OLE DB provider Performance using ADO is largely reliant on the quality of the OLE DB
provider that you are using If you are using the OLE DB provider for ODBC, an appropriate ODBC
driver must also be installed and configured
![Page 16: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/16.jpg)
MIDAS.DLLif MidasLib unit not used
Local FileXML or CDS
ClientDataSet
MyBase - ClientDataSet
![Page 17: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/17.jpg)
DataSource
ClientDataSet
Data Aware Controls
MyBase
![Page 18: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/18.jpg)
MyBase Advantages
MyBase applications have minimal installation requirements
The data can be stored in XML format, making it easy to access this data from outside of the application
Data can be loaded and saved without code. Simply point the client dataset's FileName property to a file that contains the proper XML or binary client dataset data, and it will take care of the rest. (It is better to explicity load and save using SaveToFile and LoadFromFile)
![Page 19: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/19.jpg)
MyBase Limitations
Because the records in a client dataset are stored in-memory, the number of records that you can load is limited by the amount of real and virtual memory available on your machine
Large files may take a significant amount of time to load from a file into a client dataset. For example, 100,000 records may take 5 seconds or so to load into memory
MyBase applications are limited to single user applications. If you want to create a multiuser application, you must use one of the other available technologies
![Page 20: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/20.jpg)
gds32.dll
InterBase
IBDatabase
InterBase Express
![Page 21: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/21.jpg)
IBTransaction
IBDatabase
IBTransaction
IBSQL
IBTable, IBQuery, IBStoredProc, IBDataSet
DataSource
Data Aware Controls
InterBase Express
![Page 22: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/22.jpg)
InterBase Express Advantages
InterBase Express provides access to InterBase without the BDE
Because InterBase Express components are designed specifically for InterBase, they include a number of specialized components that access and leverage InterBase features
Interbase Express components are available for both Delphi and Kylix, meaning that you can build applications that employ InterBase Express for machines running Linux
![Page 23: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/23.jpg)
InterBase Express Limitations
InterBase Express works only with the InterBase database server
![Page 24: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/24.jpg)
Database Server
DataSnap Server
DataSnap Clients DataSnap
![Page 25: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/25.jpg)
Data Access Components
Database
Remote ConnectionComponent
Remote Data Modulewith DataSetProviders
![Page 26: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/26.jpg)
DataSource
ClientDataSet
Data Aware Controls
Connection Components
SharedConnection
DataSetProvider
LocalConnection
ConnectionBroker
DataSnap
![Page 27: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/27.jpg)
DataSnap Advantages
DataSnap client applications have few installation requirements
Business rules can be implemented on a server, permitting these rules to be updated independent of the individual client applications
They permit load balancing They can implement fail-over for high reliability They provide a reliable, distributed upgrade path to
dbExpress and MyBase applications The connection components support a variety of
internetworking protocols
![Page 28: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/28.jpg)
DataSnap Limitations
While DataSnap offers additional flexibility over traditional client/server solutions, it requires more development. Specifically, in addition to writing the client application, you also need to write the application server
DataSnap applications require an additional license before they can be deployed. However, since Delphi 6, this license comes with the Enterprise and Architect editions of Delphi
DataSnap servers must also employ one of the other data access mechanisms. For example, the application server may use the BDE or ADO. As a result, DataSnap application developers must be familiar with at least two data access mechanisms (DataSnap plus at least one more)
![Page 29: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/29.jpg)
Third-Party Data Access Components
![Page 30: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/30.jpg)
Third-Party Data Controls Advantages
May support specialized features of the vendor’s database If designed with the TDataSet interface in mind, it may be easy to convert
from some other data access mechanism to the vendor’s data access mechanism
Third-party vendors are generally highly motivated to provide nearly bug-free components
![Page 31: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/31.jpg)
Third-Party Data Controls Limitations
Typically support only one database Ties you to that vendors database
![Page 32: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/32.jpg)
Data Modules
Non-visual container for non-visual components Permit sharing of objects Excellent classes for implementing custom components Are not always appropriate for data controls, especially
in the following situations Multi-instance forms Forms used for reports Unique data views
![Page 33: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/33.jpg)
Data Aware Controls
Convenient and effective Permit you to build interfaces quickly Automatically respond to changes in the data Some developers have a bias against data aware
controls In response, they often create their own framework of
data awareness with custom controls
![Page 34: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/34.jpg)
Using Providers in Database Applications
Independent layer for data access Decouples your user interface from the data access
mechanism Is a more generalized approach than data modules
![Page 35: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/35.jpg)
![Page 36: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/36.jpg)
Thank You !
Thank You !
![Page 37: Developing Win32 Database Applications with Delphi Cary Jensen Jensen Data Systems, Inc](https://reader031.vdocuments.us/reader031/viewer/2022012400/56649dc85503460f94abd8e9/html5/thumbnails/37.jpg)