Hi, I'm quite new to using oo base, but have managed, not without some cursing, to make a relational database with queries forms etc. that is just about ok. However, I have completely failed to get the primary key (id number) to auto increment. I'm at the tearing my hair out stage. I've read quite a number of posts on the subject, but not really found an answer.
My version of oo is 2.4. I've made umpteen tables from scratch, even one that had nothing *but* a primary key, set INTEGER, auto value 'YES' and absolutely no data. It seems to save ok, then if I add any other fields and look at it again it has mysteriously changed to auto value 'NO'. Ok, I can add a number myself each time I enter a new record, but this seems such a fundamental thing to expect a database to do that I just don't understand what's going on. Sorry about the rant.

Thanks for the reply. As a comparative newbie, this is something I've not really got a grasp on. I've been using Lotus Approach which pretty much does everything I want, but I want to get used to using an alternative in case Approach becomes completely obsolete. I already use oo for most other things. I started off by linking to existing databases, but am currently doing completely new databases with oo. When I looked at the connections, the current driver is set to com.sun.star.comp.sdbc.ODBCDriver. Does this mean I should probably change it?

The other one is for all tables in the database.
Open the database. not the table
goto Edit -->Database -->Advanced click
there is opening a dialog with two tabs goto tab "Generated Values"
mark the check box
write "IDENTITY" in the first line "Instruction automatic increment"
click OK

Thank you for the suggestions but I'm still having problems. I'm even wondering if I should try and completely uninstall oo and do a fresh install (XP). It doesn't help that I'm completely out of my depth with SQL.
When I looked at edit-database-advanced I got two choices, "end text lines with CTRL+LF" and "form data input checks for required fields" and that is all
Also, as soon as I save a table in design view, I can't edit the field properties at all, only add new fields. This means that if I choose to save a table and have the primary key added automatically, I can't go back and alter the properties.
I tried using the table wizard as a test and even though I selected auto value YES on that, it was all greyed out and set to NO in the design view after saving.
With all the time I'm spending on it, I may as well just add the numbers myself, but I'm stubborn and want to know why it does this!

many thanks for your time - I really hoped this would be the answer when I found I had Java installed but it was not set to the latest version. Unfortunately, even after a complete restart to make sure oo wasn't hanging on to any old settings, I still have the same problem. The table wizard works fine right up until saving then the auto value is suddenly switched from yes to no.

Sorry I can not help you but give not up. I have try to installate a linux on a 200 mhz pentium with 68 MByte. Time over time the CD would not contimue with booting . The solotion was to write the word addswap correct with double D and not one

Suddenly it works! Thanks Romke for pointing out that I need put IDENTITY in as the auto increment statement as this seems to have cured the problem - I would never have guessed that this was necessary. I did try your suggestion straight away but it made no difference and is only working after the computer was shut down overnight. Coincidence?
To sum up. I made a simple test table using the wizard, adding only the fields AccountID and Description. The AccountID field (Integer) was set to auto value, with the word IDENTITY in the box underneath. Next, I chose to set the existing field AccountID as the primary key, and noticed that the auto value check box was selected automatically. When I finished and opened the table in data input view, <auto-field> was in the AccountID column and this changed to incremental numbers as I added records. Thanks again!

I would make it complete for other readers.
You have to repeat this for every other database if you want have auto increment.
Identity is only for HSQLDB for other systems I don't know. Look in the documents.for a statement

The other one is for all tables in the database.
Open the database. not the table
goto Edit -->Database -->Advanced click
there is opening a dialog with two tabs goto tab "Generated Values"
mark the check box
write "IDENTITY" in the first line "Instruction automatic increment"
click OK

Romke

This is not an option in my version of OOo Base! No such dialog tab comes up.

This is not an option in my version of OOo Base! No such dialog tab comes up.

I don't have this either (2.4.0 for Windows). Edit > Database > Advanced Settings (the rest of the options are greyed out) yields a dialog box with only a "Special Settings" tab and two check boxes: (1) End text lines with CR+LF and (2) Form data input checks for required fields. There are no other tabs here.

I'm having a lot of problems -- so now I'm wondering if there's something wrong with my installation, which I just upgaded today.

What kind of DB engine you are using? The instruction are special for HSQLDB.
If you are using an other db engine, it is maybe possible that there is no autoincrement.
Check also if java is installed on your machine and I think you have the good tab (page)