Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Need access to Dbase3 database

Posted on 2001-08-07
2
399 Views
Last Modified: 2010-04-06
Ok. I'm rather new at Delphi, and COMPLETELY new to programming with databases. Therefore please bear with me if this seems simple to you.

I have a program that needs to access data elements from within a dbase3 compatable DBF/NDX set. Someone mentioned using TTable, so I looked into it. TTable sounds like it will work, but I cannot figure it out. Up till now the only time I was reading from anything besides a flat file (file of records) was when I was using a 3rd party database API for their format.

Basically, here's what needs to happen:

Step 1) Open Database file
Step 2) Find All records matching a criteria (in this case, all records with the same SOC_SEC field)
step 3) read the data from that database into a structure defined in memory.
step 4) fill in template with data from database file, and write to disk.
step 5) Repeat while there are records with PRINTED=N

I can do most of that myself (template included) but I cannot figure out how to obtain data from a TTable, or even how to correctly CONFIGURE the ttable so it will open the database file.

Thanks!
Dan
0
Comment
Question by:DanEgli
2 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6362708
well,
first you must forget the ndx-indexes,
they are clipper-specific and not supported by the bde,
if you use the bde

if you use the bde, the first configure an alias to your dbase-table-dirrctory with the bde-admin

in delphi just assign a ttable to this alias (property databasename) and select you table in the property tablename.

1. open the table
2. use a filter 'SOC_SEC = '+quotedStr('AStringValue')
and set filtered to true
3. table1.first
   while not Table1.eof do
   begin
     //do your recordfilling
     TheRecord.TheAttribut := table1.fieldbyname('TheFieldName').AsSomeWhatTyp;
     //...more fields
     //do somewhat with your recordstructure
     table1.next;
   end;
4. see 3
5. ?

meikl ;-)
0
 

Accepted Solution

by:
asi earned 50 total points
ID: 6363650
There are Databases interface that support this database structure

List www.advantageDatabase.com

or

www.apollodatabase.com
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 84
DBGrid or StringGrid ? 6 103
Delphi: making a BW image transparent 10 57
enhance the following code 3 37
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question