Solved

dBase DBF files and TDBGrid

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Press three keys together and trigger a function 3 56
creating threads in delphi 1 104
Adoquery sql  left join does not work 25 89
MS Access from Delphi 31 28
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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