Table structure?

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Apr 29 16:46:08 CDT 2006


On 4/29/06 1:51 AM, "Joakim Schramm" <joakim at astrocalc.com> wrote:

> I am still a bit confused about this. From example below of linking records
> 
> Private Sub LinkRecords()
> 
>   Dim mLink As VLink
>   Dim recs(1) As Variant
>   
>   ' get link object by name
>   Set mLink = mDatabase.Link("link_person_phone")
>   
>   'in this method assign values to ObjectPtr field to link records
>   ' of 2 tables in this way:
>   ' 1 - 1
>   ' 1 - 3
>   ' 2 - 4
>   ' 3 - 2
>   
>   ' 1 - 1
>   recs(0) = 1
>   recs(1) = 1
>   mLink.LinkRecords (recs)
>   
>   ' 1 - 3
>   recs(0) = 1
>   recs(1) = 3
>   mLink.LinkRecords (recs)
>   
>   ' 2 - 4
>   recs(0) = 2
>   recs(1) = 4
>   mLink.LinkRecords (recs)
>   
>   ' 3 - 2
>   recs(0) = 3
>   recs(1) = 2
>   mLink.LinkRecords (recs)
>   
> End Sub
> 
> Here we from human conception which number belong to which person, but
> computer don't have that conception.

right
 
> Isn't it that each record or pair of records need to be linked right after
> they are added or we don't know relation if first filling one table then
> next etc.? 

Right.

> I am here talking about I am going to read lots of data from
> other source, from 3 "tables". So I must either link while they are in
> "memory" or I need to store a temp pointer in memory bank (e.g. array) for
> later use - is this correct?

> As data comes from 3 sources interacting with each other I can't just do it
> all at one time as one depends on the other and the third depends on the
> first... Must be that way, right?

I already have point how to **CONVERT** your existed db.

1) as first step you can make in Valentina THE SAME relational fields.

2) import your data AS IS

3) write and run ONCE function to link records using BinaryLink with help of
info of YOUR old fields

4) DROP that OLD fields

Now you have correct database with BinaryLinks.

------------------------------
HOW TO LINK future records?

As far as I see EASY.

* you show to use list of places, right?

* user click some place -- now you know RecID of select record. Right?

* you add new record into T2 - and you also get its RecID.

* now you simple do

    binaryLink.LinkRecords( recid1, recid2 )


P.S. in the next beta build we will introduce this function to link 2
records, it will be more comfortable than using arrays now.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list