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

dBase DBF files and TDBGrid

Posted on 2002-04-11
4
381 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
Path  to current project in Delphi. 2 92
Run video youtube webbrowse 10 65
creating threads in delphi 1 131
Browsing a TTreeView in Delphi 5 7
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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