Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting up relation on index view
Message
From
08/02/2002 14:23:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00617525
Message ID:
00617609
Views:
17
>I'm not sure if I am going about this correctly, but what I am trying to do is create a relation between two views. What I have is a parent view called lv_veh (primary key is v_id, and I have a child view called lv_ser (foreign key is s_id). In DataEnvironment.Init I create the indexes. I'm not sure how to create a relation between lv_veh.v_id and lv_ser.s_id. Is it also ok to create two indexes on view in dataenvironment as shown below?
>What I am after is when I move to different record in lv_veh, I what the child lv_ser records to display correct linked records in a grid. For example if lv_veh.v_id = 20, then I want all lv_ser to show me all records s_id = 20.
>
>CURSORSETPROP('buffering',3,'lv_veh')
>SELECT lv_veh
>INDEX ON v_id TAG v_id
>CURSORSETPROP('buffering',5,'lv_veh')
>CURSORSETPROP('buffering',3,'lv_ser')
>SELECT lv_ser
>INDEX ON s_id TAG s_id
>CURSORSETPROP('buffering',5,'lv_ser')
>
>Thanks
>Nick Patel

Nick,
With the index created you could set the relation however you don't need to.
with thisform.myGrid
 .ChildOrder = 's_id'
 .LinkMaster = 'lv_veh'
 .RelationalExpr = 'v_id'
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform