|
|
|
The following routine takes 2 arguments, ADO recordset and flexgrid which you want to fill. |
Click here to copy the following block | Sub FillFlexgrid(rst As ADODB.Recordset, msfGrid As MSFlexGrid) Dim cln As Field With msfGrid .Rows = 2 .Cols = rst.Fields.Count .FixedRows = 1 .FixedCols = 0 .Row = 0 .Col = 0 For Each cln In rst.Fields .Text = cln.Name If .Col < .Cols - 1 Then .Col = .Col + 1 Next Do While Not rst.EOF .Row = rst.AbsolutePosition .Col = 0 For Each cln In rst.Fields If Not IsNull(cln.Value) Then .Text = Trim(CStr(cln.Value)) Else .Text = "" End If If .Col < .Cols - 1 Then .Col = .Col + 1 Next rst.MoveNext .Rows = .Rows + 1 Loop .Rows = .Rows - 1 .Row = 0 End With
End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|