Dim adoConnectionX As New ADODB.Connection
Dim adoRecordset As New ADODB.Recordset
'adoConnectionX.Open "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Tree.mdb;Persist Security Info=False"
'adoConnectionX.Open "Provider=MSDataShape;Data Provider=MSDAORA.1;Password=1;User ID=YUDEMO1;Data Source=NAMEPIPE1;Persist Security Info=True"
adoConnectionX.Open "Provider=MSDataShape;Data Provider=MSDASQL.1;User ID=dba;Password = sql;driver=Adaptive Server Anywhere 6.0;Database=" & App.Path & "\TREE.db"
adoRecordset.Open "SHAPE{SELECT Classid as 类别编码,Classname as 类别名称 FROM TREE where parentid='root'}APPEND((SHAPE{SELECT Classid as 类别编码,Classname as 类别名称,Parentid as 上级编码 FROM TREE}APPEND((SHAPE{SELECT Classid as 类别编码,Classname as 类别名称,Parentid as 上级编码 FROM TREE}APPEND({SELECT Classid as 类别编码,Classname as 类别名称,Parentid as 上级编码 FROM TREE}RELATE 类别编码 TO 上级编码))RELATE 类别编码 TO 上级编码)AS AB)RELATE 类别编码 TO 上级编码)AS AA ", adoConnectionX
Set MSHFlexGrid1.DataSource = adoRecordset
MSHFlexGrid1.AllowUserResizing = flexResizeColumns
MSHFlexGrid1.AllowBigSelection = True