Solved

dBase DBF files and TDBGrid

Posted on 2002-04-11
4
378 Views
Last Modified: 2010-04-04
If I create a dBase III DBF file, and create an index with this DBF, and then use Delphi 3 with a TDBGrid component, I notice unusual behavior with the TDBGrid whenever the Index is active.

Example, let's say the DBF contains 1000 records.  When my D3 application is running, and the table is active, and the index is active, the only positions that you can move the thumb tracking button in the vertical scroll bar is: TOP, MIDDLE, BOTTOM (0%, 50%, 100%).   It is impossible to move the thumb button to 25% or 75% or 33%.  However, if I DROP the index (make it inactive), then I CAN move the thumb button to intermediate positions (10%, 25%, etc.).

Why is this, and how can I use an index with my DBF while at the same time be able to have better thumb button tracking control over the table?
0
Comment
Question by:Kapusta
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 40 total points
ID: 6934180
thats not only with dbase-files,
this bahaviour is because the dataset self don't
knows how much records are there,
therefore the tdbgrid is unable to scale the scrollbar

just in simple words

meikl ;-)
0
 

Author Comment

by:Kapusta
ID: 6934888
Why can't it know how many records there are?  How tough is it to perform a lookup to the .RecCount property?  And why if I drop/deactivate the index then the thumb button DOES behave properly?  How can the TDbgrib able to know the # of records when the index is deactivated but it doesn't know the # of records when the index is active?  That doesn't make sense!
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6936383
hehe :-)

well it sounds like an paradoxon,
but the access without index is another than with index,

with index the bahaviour is like on a sql-database,
the fetches comes in parts until the sql-server signals the last fetch, until then the recordcount is unknown.

it may help, to call the last-method followed by the firstmethod after open the table to force fetching all records, some datasets are providing a fetchall-method.

meikl ;-)
0
 

Author Comment

by:Kapusta
ID: 6936654
I came across the following possible solution:

http://www.jpmartel.com/bu15_c.htm
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now