Link to home
Start Free TrialLog in
Avatar of PACS
PACS

asked on

AutoIncrement Access from BDE

Greetings,

We have an autoincrement field in a file (BDE/PARADOX) that has been set to a low value (how, is unknown at the moment).  We would like to be able to rewrite the header of the file so that the autoincrement field is set to a non-duplicate (proper) value again.  The code to get the largest existing value is a piece of cake.  The challenge is to rewrite the header with this value.  Anyone have any ideas?  The goal would be to write code to do this (rewrite the header).  We can not rewrite the file out since the autoincrement fields would be renumbered (other files need the existing numbers).

Thanks in advance....

John Wilson
Senior Software Engineer
PACS Software, Inc.
jwilson@pacsusa.com
Avatar of PACS
PACS

ASKER

This can be done through the database desktop by restructuring the table -- setting the minimum value for the auto-increment field, adding a record, and clearing the minimum value.  Would be nice to do in code though.  I've got the core of the program done... available BDE (doesn't work with normal Delphi calls) documentation is not good.  Any example of adding a minimum value to a file before the restructuring (dbidorestructure) in code would be useful.  jw (06/03/97).

John,

Just a suggestion - refrain from using Autoincrement fields as keys. If your table gets corrupted and you need to rebuild it, getting the BDE to use exactly the same values for the AI fields is very difficult.
ASKER CERTIFIED SOLUTION
Avatar of JGREER
JGREER

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial