Auto Increment on Split Database

Background: I had a base database that was getting corrupted and found the Split conversion process and after a fashion things worked. Here’s my original post on my issue:

And here’s the process I followed to create my split database:
https://forum.openoffice.org/en/forum/viewtopic.php?t=61183

I copied and pasted from my old database to the new split and all works except for autoincrement of the index. I found this link and got that working except for the ‘bug’ as reported in this link:

When I create a new record or multiple records in the form the index field always displays 0 but when the database is closed and reopened the index field shows the correct index value. I tried making the edits to the .xml file but couldn’t really locate the are causing the issue.

The reason you cannot find the correct line to delete is that the answer you were looking at for the xxx.xml deletion was specific to the situation of the question asked. Your situation, and which line is to be deleted, will probably be different because of table and field names. Since I don’t have any of your information on these specifics, I will present an example. When modifying anything like this it is highly recommended you keep a backup copy of your .odb in case something was incorrectly changed.

This example works with table named “TESTCOPY1” and the problem field is “ID”. After applying the ALTER statement, as you already have done in the previous post, entering data will appear as:

image description

with all the “ID” fields showing “0”. The fix to this is deleting a line in the content.xml file of the .odb. Open the .odb with an archive manager and then open the “content.xml” file with a text editor. In the text editor, use the FIND function from menu (different depending on editor used) and search for the first occurrence of your table name. In the example it is “TESTCOPY1”. Here is the result:

Following this line, you will see the field which is having this problem. In this case it is the first field in the table and is named “ID” as noted previously. Now the key is to select the pertinent information to be deleted. For this example here is the selection:

Note, “TESTCOPY1” is in yellow because of the search and is not part of the highlighted selection. The selection starts with <db:column which is is followed by the section containing the name of the field with the problem and ends before the next <db:column (or <db:columns if this was the last field in the table).

When this is selected just delete (delete key). Save the "content.xml file and if using an archive manager you will get a message to update the archive:

Update and the .odb is fixed. New table entries should now be correctly displayed:

image description

If this answers your question please click on the :heavy_check_mark: (upper left area of answer).

Thanks, this helped.

More than just helping I certainly hope this solved your problem. I also apologize for not warning you about this in the first place. It was simply a matter of forgetting that this occurs. As you might well see by now, depending upon what you are doing in Base, it can complicate things. But it gets better.