delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Create Your Own Custom Dataset (part Due)...Component available for this articleFormat this article printer-friendly!Bookmark function is only available for registered users!
Creating DAC customizable field tables has become childs play!
Product:
Delphi 5.x (or higher)
Category:
Database-VCL
Skill Level:
Scoring:
Last Update:
10/29/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet DAC direct access direct-access hybridgraf tutorial dataset
Times Scored:
4
Visits:
5905
Uploader: William Anthony Amaral B
Company: HybridGRAF Interactive
Reference: N/A
Component Download: http://www.taxisairport.com/dhype/downloads/cds2.rar
 
Question/Problem/Abstract:
How to create direct access dataset
Answer:



Creating Custom Datasets
(Part DUE)

Want to read "Create You Own Custom Dataset!" (Part 1)

In this tutorial we will see how to create a working Table with Dynamic Field Defs,
just like a normal table.

Next tutorial we will learn no make a DAC:DBF (DBase III) DataSet.
And we will lean to use Indexing, Filtering, Etc.

Standard Table Layout
  
Structure Size in Bytes
Header 6
Field Defs ???
Actual Data ???


File Header
  
Field Size in Bytes
Table ID  2
Version 1
Sub Version  1
FieldDefs Count 2

FieldDefs Count contains the amount of FieldRecords to read

Field Defs Record
  We will focus on the main data types, for example Strings, Integer, Float, Etc.

Field Size in Bytes
Name 20
DataType 2
Size 2
Required 2

How to process file
  InternalOpen

This procedure will have to read the File Header,
Store the FieldDef Count and Call InitFieldDefs

InternalInitFieldDefs

This procedure will have to read the FieldDefs Records and convert them his own format.

Read Header from Position 0 to Header Size
(in this case the header size is 6 bytes)
Store FieldDefs Record-Count
Read FieldDefs Record(s)
Convert Record to actual FieldDefs
Tutorial Download
  Now for the HANDS-ON part of the tutorial!
The code was writen in Delphi 6 and working just fine.

The archive contains not only the THGDataSet source but a Table Builder application source.

Download NOW!
(WinRAR 3.0 Required)

Word to the wize
  Practice makes perfect, please write your own and read the source carefully, download both this part and the first part archives to get a better feel to the changes.

I change my coding style alittle every tutorial, from easy to hard so read carefully.

All sources are WELL commentated.

ENJOY!






Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
D. Wischnewski
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)