Board index » delphi » DataBase Problems

DataBase Problems

I am running Win95, BP7, and Borland's Turbo DataBase Toolbox version
4.00 routines to create and maintain a large database indexed on
surname, given_name, etc.

The indexing routines return error code 100:Disk Read Error when adding
the index for record number 1,207,685.

I can remove indexing routines from the program and add records beyond
that point.

Any help, please

Tom

tatk...@sk.sympatico.ca

 

Re:DataBase Problems


Quote
Stephen Atkins <atk...@cs.uregina.ca> wrote:
>I am running Win95, BP7, and Borland's Turbo DataBase Toolbox version
>4.00 routines to create and maintain a large database indexed on
>surname, given_name, etc.

>The indexing routines return error code 100:Disk Read Error when adding
>the index for record number 1,207,685.

>I can remove indexing routines from the program and add records beyond
>that point.

The index is the only thing I use out of the tool box.  I know
I've used it well past the 2 million key range and I've never
encountered problems.  I'll bet you followed the advice in the
manual and designed the index using a fairly small size page.  
(TAccess PageSize is the maximum number of keys per page).  When
I read on page 20 that the database was limited to 65536 records
and seeing no such limit in the code, and remembering going
through the drill of changing the 3.0 toolbox reals to longints,
I decided to reload the stuff from the original 4.0 diskettes to
be sure I hadn't changed something that would prevent me from
identifying your problem.

Seems that when taccess was upgraded from 3.0 to 4.0, someone
must have felt you would never need more than 32767 index pages.
Why else would the page number parameter in the TaGetPage
procedure remain an integer?  Everywhere, page, record and
reference numbers are longint, except for taGetPage which
accepts an integer.  Since this "integer" will be sign-extended
to longint before being passed to the seek procedure, it's easy
to see where the unsigned offset passed to DOS by the seek
(RecNo * RecSize) would be well beyond the physical end of the
file the moment you go beyond index page 32767.  The exact key
number that would cause the error would depend upon how full
each index page was.

This is a good example why I ship production programs with range
checking on!  Bet an error 201 with an address that guided you
right to the offending TaGetPage call would have put you on the
right track.  IMO only games can afford to turn off such traps.

Suggest you locate TaGetPage and change parameter "R: Integer"
to be "R: Longint".  If that doesn't fix the problem post the
design parameters in taccess.def so that we can replicate the
problem and we'll have another go at it.

    ...red

--
Support the anti-Spam amendment
  Join at http://www.cauce.org/

Other Threads