Home arrow Delphi-Kylix arrow Page 2 - Using Delphi with ADO
DELPHI-KYLIX

Using Delphi with ADO


This article, the first of three parts, shows you how to access and change database content using Delphi and ADO. Accessing data both with and without data aware components is covered.

Author Info:
By: Jacques Noah
Rating: 4 stars4 stars4 stars4 stars4 stars / 15
October 02, 2006
TABLE OF CONTENTS:
  1. · Using Delphi with ADO
  2. · Accessing Database Content
  3. · Practical Example with Data Aware Components
  4. · Practical Example Without Data Aware Components

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Using Delphi with ADO - Accessing Database Content
(Page 2 of 4 )

Delphi 7, which I'm using for this article, ships with a host of ADO components,  located on the ADO tab. There you will find ADOTable, ADOQuery, and so on. These are mostly referred to as Datasets. There are two ways to access data in a database using ADO:

  1. Through Data Aware components located on the Data Controls tab. These components connect to a dataset through a datasource, and enable you to view the contents of a database. The components also enable you to manipulate records in a database without writing a single line of code. The downside of this approach is:

    • They use a lot of memory, compared to ordinary components.
    • They are not very flexible, and therefore not suitable for most real world database applications.
  2. Through ordinary components, programmatically. This approach gives you more flexibility and greatly improves the chances of you creating effective real world database applications.

To access database content in Delphi, we need what is called a connection string. A connection string tells the application where the database is located on your hard disk. This property is available in all ADO datasets. If you develop your applications with data aware components, you are going to need a datasource component. This component is located on the Data Access tab, and acts as a connector that connects datasets (for example ADOTable) to a data aware component, such as a DBGrid. In the example below, I will demonstrate how the components are connected together.


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials