#include adoconstants.h LOCAL oRS as ADODB.Recordset oRS = CREATEOBJECT("ADODB.Recordset") WITH oRS.Fields .Append("CustomerID", adInteger,, adFldUpdatable) .Append("Company", adVarChar, 50, adFldUpdatable) .Append("Contact", adVarChar, 20, adFldUpdatable) .Append("MyDateTime", adDate,, adFldUpdatable) .Append("MyDate", adDBDate,, adFldUpdatable) .Append("MyTime", adDBTime,, adFldUpdatable) EndWith With oRs .Open() FOR ix = 1 TO 10 .AddNew .Fields(0) = m.ix .Fields(1) = "Company " + TRANSFORM(m.ix) .Fields(2) = "Contact " + TRANSFORM(m.ix) .Fields(3) = DATETIME() + m.ix*1000 .Fields(4) = DATE()+m.ix .Fields(5) = DATETIME() + m.ix*1000 ENDFOR .AddNew && defaults .UpdateBatch ENDWITH ShowMe(oRS) Function ShowMe Lparameters toRecordset PUBLIC oForm oForm = Createobject('myForm', toRecordset) oForm.Show Endfunc Define Class myform As Form Height = 450 Width = 750 Add Object hflex As OleControl With ; Top = 10, Left = 10, Height = 430, Width = 730, Name = "Hflex", ; OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid' Procedure Init Lparameters toRecordset With This.hflex .FixedCols = 0 .Datasource = toRecordset .AllowUSerResizing = 3 .CollapseAll Endwith Endproc EnddefineCetin