ah, your objSource is a data provider
sorry for my ignorance, I haven't played with making a data provider as of yet....
this will put your data into a flexgrid -- you'll want to add column headings and stuff, but this will get you started
Code:Dim cn As New Connection Dim rs As New Recordset Dim strRS As String Dim strRows() As String Dim i As Long cn.Open "Provider=Microsoft.jet.OLEDB.4.0;Data Source=Nwind.mdb" 'get rs rs.Open "Select * from Customers", cn, adOpenStatic, adLockReadOnly, adCmdText 'set number of cols MSFlexGrid1.Cols = rs.Fields.Count 'get formatted string of data -- use the vbTab because 'that is how the msflexgrid likes it as a parameter strRS = rs.GetString(, , vbTab, "|", "") 'separate by rows into array strRows = Split(strRS, "|") 'loop thru array For i = LBound(strRows) To UBound(strRows) 'add row to grid MSFlexGrid1.AddItem strRows(i) DoEvents Next i 'cleanup....




Reply With Quote