Table structure?

Joakim Schramm joakim at astrocalc.com
Sat Apr 29 00:29:12 CDT 2006


Something like this?

Sub CreateLinks()
Dim mTblCountry As VTable
Dim mTblPlaces As VTable
Dim mTblZones As VTable
Dim blink As VLink

' get table references
Set mTblCountry = mDatabase.Table("Country")
Set mTblPlaces = mDatabase.Table("Places")
Set mTblZones = mDatabase.Table("ZoneData")
' create BINARY LINK between 2 tables.
Set blink = mDatabase.CreateBinaryLink("lnkCountryPlace", mTblCountry,
mTblPlaces, EVLinkType.kOne, EVLinkType.kMany)
Set blink = mDatabase.CreateBinaryLink("lnkCountryZone", mTblCountry,
mTblZones, EVLinkType.kOne, EVLinkType.kMany)
Set blink = mDatabase.CreateBinaryLink("lnkCountryPlace", mTblZones,
mTblPlaces, EVLinkType.kOne, EVLinkType.kMany)
End Sub

Joakim 

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: 29 April 2006 00:11
> To: valentina at lists.macserve.net
> Subject: Re: Table structure?
> 
> On 4/29/06 1:04 AM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
> 
> > Country has Places
> >    1          M
> > Country has Zones
> >    1          M
> > Places  has Zone(s)
> >    M           1
> > 
> >    /--T1 
> >   /   |
> > T0    |-- Result
> >   \   |
> >    \--T2
> > 
> > In words it's like, a place is located in country (we know), most 
> > country has normally just one zone but some has many. Each place is 
> > located in 1 of countries zones. App lookup place and get 
> country and 
> > which zone in country it's located. Each Zone has different 
> DateTimes 
> > for change of zone hour, in relation to GMT (=0) if not SDT.
> > 
> > Is it understandble?
> 
> Yes, now we talk on natural language of humans! :-)
> 
>     you have 3 Tables and 3 links between them
> 
>     so you need 3 Tables and 3 BinaryLinks between them.
> 
> Agree?
> 
> --
> 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]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list