如何在VB6.0里使用MSFlexGrid将Access中的数据导进来

2024-12-01 11:41:44
推荐回答(1个)
回答1:

何必搞得这么复杂,用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