*表结构:
*父子表(id int,name c(20),p_id int) &&p_id为此id的上1级id,此3个字段必须有
create cursor 父子表(id int,name c(20),p_id int)
insert into 父子表(id,name,p_id) values(1,'广东省',0)
insert into 父子表(id,name,p_id) values(2,'广西省',0)
insert into 父子表(id,name,p_id) values(3,'深圳市',1)
insert into 父子表(id,name,p_id) values(4,'广州市',1)
insert into 父子表(id,name,p_id) values(5,'福田区',3)
insert into 父子表(id,name,p_id) values(6,'龙岗区',3)
insert into 父子表(id,name,p_id) values(7,'越秀区',4)
insert into 父子表(id,name,p_id) values(8,'东山区',4)
*combo1的数据源
select * from 父子表 where p_id=0 into cursos cb1
*combo2的数据源
select * from 父子表 where p_id in(select id from cb1 where allt(name)=allt()) into cursos cb2
*combo3的数据源
select * from 父子表 where p_id in(select id from cb2 where allt(name)=allt()) into cursos cb3
*联动
*在combo1.Init 上写
select * from 父子表 where p_id=0 into cursos cb1
'cb1'
*在combo1.InteractiveChange 上写
select * from 父子表 where p_id in(select id from cb1 where allt(name)=allt()) into cursos cb2
'cb2'
*在combo2.InteractiveChange 上写
select * from 父子表 where p_id in(select id from cb2 where allt(name)=allt()) into cursos cb3
'cb3'