Solved

AutoIncrement Access from BDE

Posted on 1997-06-03
3
281 Views
Last Modified: 2010-04-06
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
0
Comment
Question by:PACS
[X]
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
3 Comments
 

Author Comment

by:PACS
ID: 1336793
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).

0
 
LVL 1

Expert Comment

by:ygolan
ID: 1336794
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.
0
 

Accepted Solution

by:
JGREER earned 200 total points
ID: 1336795
1. Rebuild the table (Autoincrement header info is either lost or incorrect.

2. Restructure the table setting the Autoincrement field(s) to 'I'nteger types.

3. Save the table.

4.  Restructure the table setting the Autoincrement field(s) back to AutoIncrement and save the table again.

5. The next record added will be last value +1

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

615 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