何必搞得这么复杂,用MSHFlexGrid代替MSFlexGrid
向工程添加部件:microsoft hierarchical flexgrid control
然后用下面的代码同样能达到要求:
Set Conn = CreateObject("ADODB.Connection")
Set Reco = CreateObject("ADODB.Recordset")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb"
Reco.CursorLocation = adUseClient
Reco.Open "Select * From zhuhu ", Conn, 1, 1
set MSHFlexGrid1.DataSource=Reco