Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Neooffice 2.0 Database Relationships
Neooffice 2.0 Database Relationships
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
FredBlogs
Blue Pill


Joined: Aug 29, 2006
Posts: 3

PostPosted: Tue Sep 05, 2006 7:25 pm    Post subject: Neooffice 2.0 Database Relationships

When I try making a relationship between two databases i get the following error:
Error while connecting to the data source

Primary or unique constraint required on main table: "Bacchus wine club customers" in statement [ALTER TABLE "Collections" ADD FORIEGN KEY ("Type") REFERENCES "Bacchus Wine Club Customers" ("Item")]


I checked the neoOffice help files the closest thing i can find help on adding a foreign key is the primary key topic

Any help would be appreciated
Back to top
valterb
The Anomaly
(earlier version)


Joined: Sep 23, 2005
Posts: 463
Location: San Giuliano Terme, Pisa, Italy

PostPosted: Tue Sep 05, 2006 10:41 pm    Post subject:

Well, it seems that you haven't create a primary key in your tables. Try to create it (I think you need a primary keys in both tables), and have a look at what happen.

To do that go in table design mode (select your table, ctrl-click and choose edit). On the left of the table choose one of the row that contains unique data (for this reason is possible that you have created an ID field) and ctrl-click on it. Choose primary key. Save your table and go to create the relationship.

Valter
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: Wed Sep 06, 2006 1:59 am    Post subject:

For a quick (and rough) guide to setting up tables with relationships take a look at this post. Smile

Andy.
Back to top
FredBlogs
Blue Pill


Joined: Aug 29, 2006
Posts: 3

PostPosted: Wed Sep 06, 2006 2:44 am    Post subject:

both tables have primary keys and it still keeps giving me the error
Back to top
valterb
The Anomaly
(earlier version)


Joined: Sep 23, 2005
Posts: 463
Location: San Giuliano Terme, Pisa, Italy

PostPosted: Wed Sep 06, 2006 5:20 am    Post subject:

So if the problem is not primary key is "unique constraint".
Try to do this. Go to Tool -> SQL.
Than type a command to add a constraint. The command should be something like
Code:
ALTER TABLE "Name OfYourTable" ADD CONSTRAINT unq_signup UNIQUE ("FieldsNamesSeparatedByComma")


Valter
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.