Populating MsHFlexgrid with ADODB recordset

sambase
10-18-2004, 03:22 AM
Hi,

im trying to populate an Flexgrid with data from a recordset using an ADO connection. I can't seem to get it going.

Code:



Private Sub Command1_Click()
Dim myconn As ADODB.Connection
Dim myRecSet As ADODB.Recordset
Dim strdata As String
Set myconn = New ADODB.Connection
myconn.ConnectionString = "Provider=microsoft.jet.OLEDB.4.0;Data Source=N:\db2.mdb;"
myconn.Open



Do While Not myRecSet.EOF
strdata = "SELECT * FROM Accounts"
Flexgrid.AddItem (strdata)
Loop

End Sub


Any Ideas?

Cheers,

Sam

Shurik12
10-18-2004, 03:52 AM
Hi,
Have a look here:
http://www.visualbasicforum.com/showthread.php?t=35110

On the other hand if you switch to MSHFlexGrid all it'd take to populate the grid is:

Set MyMSHFlexGrid.Recordset=rs


Shurik.

sambase
10-18-2004, 04:02 AM
That simple?

Thanks mate.

Sam

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum