Solved

dBase DBF files and TDBGrid

Posted on 2002-04-11
4
382 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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