Search   Contact   Home    
ProductsSupportDownloadsSpeech TechnologyLinksCustomer CommentsFree Stuff

Answers to Frequently Asked Questions about the TTUtility Table Repair Components

Table of Contents

  1. I understand that I could have a problem rebuilding tables with auto-increment field types. Could you tell me what the issue is and how to solve it?
  2. After rebuilding a table with an autoincrement key I can't add new records because I get a key violation. Why? and how do I fix this.
  3. When I drop the TU component onto a form I get an access violation.

If you can't find the answer to you question here then drop us a line at support@o2a.com. We always like a good question.

I understand that I could have a problem rebuilding tables with auto-increment field types. Could you tell me what the issue is and how to solve it?

Yes there is a problem with rebuilding tables correctly that have auto-increment field types using the TUTILITY.DLL. The problem effects both our TTUtility component and Borland's table repair in Paradox. This problem is fixed with the TUTIL32.DLL that shipped with Paradox 7.

The problem is that the rebuild method resets the values of auto increment field types during the rebuild. So, for example, if you have a table with three records and the record has an auto-inc field with values 1, 3, and 5 to start, after a rebuild the values in the auto-inc field will be 1, 2, and 3. Since auto-inc fields are usually used to establish unique keys for the purposes of relating files, this reordering of the key is "not a good thing".

Here are some options.

  1. Remove all auto-increment field types from your tables and use a different method for assigning unique keys (this is the perfered solution).
  2. Keep a good copy of your table that has replaced the auto-inc fields with long integer fields. Then if the table gets corrupted borrow this tables structure for the rebuild. Then after the rebuild is complete us either DB desktop or Paradox to restructure the file, setting the long integer fields back to auto-increment fields.

After rebuilding a table with an autoincrement key I can't add new records because I get a key violation. Why? and how do I fix this.

This problem is usually caused by a corrupt autoincrement seed in the header of the DB file. The DB file  contains a header section followed by the Data section. The header section contains a number of pieces of information critical to keeping the data organized and meaningful. Among other things the header stores the "seed" for the autoincrement key. That it, it stores the value for the last autoincrement value plus one. 

Sometimes when a table is damaged by an invalid close of the BDE (power loss, Ctrl-alt-delete) or by not properly setting the LOCAL SHARE to TRUE in the BDE Administratior - Configuration - System - INIT, the autoincrement seed is not updated when a new record is created so when the next record tries to be created a "key violation" or "duplicate value in unique key" error is generated.

Unfortunately the TUTIL32.DLL can not fix this problem. 

When this happens, the recommended fix is to use Database Desktop to restructure the table (Tools | Restructure) changing the autoincrement field type to a "Long Integer" field type then save the changes then restructure the table again changing the field type back to the autoincrement field type.

NOTE: Our testing shows that if LOCAL SHARE is not correctly set that this problem will happen quite ofter.

When I drop the TU component onto a form I get an access violation.

You have probably just recently installed Paradox 8 or WP Pro. If this is the case, it turns out that there is an error in those programs installer that incorrectly puts a trailing semicolon in an inportant registery path. To fix this go to start | run and type regedit and press ok. Once the registery appears havigate to \HKEY_LOCAL_MACHINE\Software\Borland\Database Engine and double click on the "DLLPATH" in the right window. You should find a trailing semicolon in the string. Delete it. Press OK and close the registery editor. That should fix the problem.

Back to Top
Back to O&A Home Page

Top of Page

 

E-Mail us  
  Search | Contact | Products | Services & Support | Downloads | Speech | Links | Comments
Last updated October 20, 2005
© 1999, 2000 O&A Productions