Apache OpenOffice (AOO) Bugzilla – Issue 81929
FKs not deleting properly
Last modified: 2008-05-07 10:44:47 UTC
I added a few tables to an existing database, but when I was mid-way through setting the relationships in the GUI I realised I had assigned an incorrect field length. I deleted the tables from the relationship window, made the changes and went back to establish the relationships; but every time I did it returned a 'Foreign Key already exists' error message. So I deleted the tables entirely and rebuilt them from scratch, and that seemed to fix the problem. But when I restarted Base, the connection to that db (and only that db) was lost. The above was all done in v2.2.1; I checked for OO updates and installed v2.3, which gave me a nice verbose error message: "error in script file line 41: constraint already exists: SYS_FK_932 in statement [CREATE CACHED TABLE ....]" (and then it defines the table indices). Clearly, the indexes were not correctly purged when I made those deletions. The problem is, now I can't access the db in order to remove the duplicate key in the GUI. Can someone please advise me how to do this manually? I'm running Vista Home Premium 32-bit. I'll also attach the corrupted file for autopsy.
Created attachment 48472 [details] The corrupted base file
I had this issue occur to me again; it seems to happen if I delete an FK, rename the table, and then re-do the FK. You only notice it after restarting Base and the connection is re-connected.
For how to fix the concrete DB: Unzip the .odb, edit the file database/script, in line 41, and try to e.g. renamed the first occurrence of SYS_FK_932 to SYS_FK_933. The re-zip, and try again. (side note: The proper place to get this kind of support is our project's mailing list, see http://wiki.services.openoffice.org/wiki/Base_Mailing_List. You would have got an answer much faster, probably.)
For the concrete problem: Sadly, I cannot reproduce it. Neither with the original description, nor with what you wrote in the additional comment. Could you try reproducing this, again, and explain step-for-step what you're doing, preferrably with a sample database?
set 'worksforme'
no respond => close