Cardbox Talk


CardboxForumsCardbox Talk > "Relational"


How to create

Posted By Post


5-Jan-2013 17:14

I am new to cardbox and it seems ideal for what I want. I have created my first simple data base easily and successfully. I would now like to expand it and create a relational file.

For example I have a list of wildlife and I want to add an ever growing list of the dates and places I have found them. Is there a very simple guide to doing this or better still is there a sample file I can download and use as a guide and build on that.



Charles Welling

5-Jan-2013 19:16

A Cardbox file is not relational; it never is. That's one of the reasons why they are to simple to make and maintain. Cardbox has however a very powerful feature: relational searching. Relational searching does not depend on the structure of the files. It comes down to the following:

Database A and database B contain records and these records contain data. Both databases can be searched and edited independently.
If A and B have some data in common, you can use that data to find records in B using the contents of records from A as a search command.

For instance:

A and B both contain the names of animals. Let's assume this field is called SPECIES.
Open both databases. Activate B and set up a relational search, i.e. tell B to find all records containing a specific name in the field SPECIES and to take these names from the active record in A. The fields that are linked this way do not necessarily have to have corresponding names.

Suppose you then browse through A. Record 1 contains "hare". This name is sent to B and a selection appears of all records with "hare". You browse to record 2 from A which contains "falcon". The selection in B immediately changes and displays all records of falcons. Etc.

You can also set this up the other way around, which means you can have A show all the specifics of wildlife that occur in B.


5-Jan-2013 20:14

Thank you Charles

I can work on that.


13-Jan-2013 03:50

I also am new to Cardbox and for an art show I am running I need to create a database that manages
1...artist details (Name address etc)
2...painting details ( atrist, medium, name price etc)

My question is should I

A... put all data in the one "artist" file with fields for up to 5 ( the max allowed) paintings)
B... create two database one "artist" and another "paintings" and create catalogue etc using Charles's suggestion above.
many thanks for any and all advice
and apologies for asking what must be a very basic question to experienced users.

Charles Welling

13-Jan-2013 09:35

No apologies are called for. On the contrary: your question indicates that you thought things over.

The "trouble" is that the flexibility of Cardbox allows you to do both with equally good results. Let's take a look at this from both ends:

Suppose you want to create a database with the artist details and a single work of art per artist. In that case you would never consider splitting the data.

On the other end you could have a database with artist details and an unlimited number of works of art per artist. In that case setting up two different databases could be an option. Whether you actually do this depends on the complexity of the data you wish to record for each work of art.
Suppose you only want to record the titles of the paintings. Then there would be no need for a separate database. You could have a single field TITLE in your artist's record which could contain an unlimited number of titles.
When the data on the works of art is extensive, most likely including images, that would still be possible, but extremely unpracticle. In that case a separate database is the best solution with separate records for each work of art, linked to a database with a single record per artist.

Your database is somewhere in-between. You could easily have a single database, especially as there is a limited number of works of art. You could even have single fields for name, medium, price etc. all containing your maximum of 5 entries, where the first name corresponds with the first price and the first medium etc.
A separate database could work as well.

Perhaps now you see why I used the word "trouble". Cardbox allows you to do things in many ways, which makes it sometimes hard to decide which is best.

In your case both options are more or less balanced. If however you want to make printed copies, I'd go for the single-file option. There's no easy way to print data from two databases as a single copy.

Whatever you decide, remember that it's easy to change things. If necessary you could easily update a single file to a relational setup.

The best advice I could give you is that you test both options before you really give it a go.


14-Jan-2013 23:29

Charles did say

'....There's no easy way to print data from two databases as a single copy.'

That statement leads me to the single datab ase option because a major task is to prepare a PDF file for the catalogue.
There is an entries close date surrounded by a rush of entries and a need to process those entries promptly in order to produce listing for the catalogue.

Many thanks Charles for your assistance



2-Feb-2014 17:41

I'm a convert..I've bought the Book but it says very little about the relational aspects of Cardbox. I would really like to get my hands on a sample database which can show me how best to proceed. I have been an avid user of Rapidfile for over 25 years and I just get the feeling that Cardbox builds on that simplicity but adds much more including relations/linking. My goal is to develop a "simple" database for parents and students for emailing purposes. Given that parents have multiple children and children have multiple parents my head starts to spin, so any guidance will be much appreciated. I am very new to this so please be patient. Many thanks


2-Feb-2014 18:42

Again: Cardbox is not a relational database. And it is not RapidFile clown.
Relational search can perhaps be a nice option, but I must say that I never have seen a application which used it smart and good. Also, as written before in this threat, you cannot make a form (format) that uses two databases.

Best workaround for these limits is programming macros. You could make a database for parents and a database for children. Make for adding records a macro which can connect a key field in both, and run from time to time a macro which updates all records of the parents database by renewing the children field in that db). Then you get one flat database with parents & children which easy can be updated by a macro.
For database lovers this is a terrible way of thinking. They need a relational db. However, my experience is that the solution as I suggest a good alternative is for much vulnerable relational databases and in some way even has better features/possibilities.
So if a relational database is more important than easy collection data and transparent administration, do not use Cardbox.


3-Feb-2014 10:24

Hi Bert, Thanky for the quick reply. I was clear that Cardbox is not a relational database but equally clear that it can make relational links. I only mentioned Rapidfile to indicate that my skill is fairly basic and that over the years I have been able to do a lot of good work with it.

Obviously Cardbox can go a lot further and when I saw the example of the Galpin Society Membership database on page 225 of the Cardbox Book, which shows two files open and related, I felt that Cardbox could offer me a solution.

I have a better idea on how to proceed but you can't beat example files to play with.


3-Feb-2014 11:51

Cardbox Sample files: the re installed in a subfolder of the program folder of Cardbox.
You edit the files if you copy the files (+ subfolders) to another location on your disk.
regards en success


7-Feb-2014 11:38

I know where the sample files are. My question relates to sample files using relational links. There are no sample files using relational links ... or am I going blind!

I repeat, the Galpin society is mentioned as an example of using links but NO FILES TO PLAY WITH


7-Feb-2014 13:10

The menu section has an entry called Help points
fill in 500 to find out more about relational linking


10-Feb-2014 10:08

In sample db Contact is a simple relational search possible:
Do this:
-open contacts
-then open contacts a second time
-shift-f4 for tiling windows
-click on contacts #2 - so that window is active
-the men relational search
-above field: county
-under field: county
Then: The county of the records shown in Contact, is selected in Contacts #2.
If you browse in Contacts, you can see that the selection in Contacts #2 will change.

So you are not blind, you only did not read the right stuff...

© 2010 Cardbox Software Limited   Home