ADODB.Recordset and MSHFlexGrid

sambase
10-19-2004, 07:58 AM
im trying to add data from a recordset into my MSHFlexGrid.


Private Sub cmdOk_Click()
Dim myConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Set myConn = New ADODB.Connection
myConn.ConnectionString = "provider=microsoft.jet.OLEDB.4..0;Data Source=N:\db2.mdb;"
myConn.Open

Dim strSQL As String

strSQL = "SELECT * FROM Member"

Set MSHFlexGrid1.Recordset = MyRecSet

End Sub

this doesn't work.

Any ideas?

sam

Shurik12
10-19-2004, 08:12 AM
But where are you effectively opening your recordset (all you seem to have opened is the connection)?

sambase
10-19-2004, 08:20 AM
strSQL = "SELECT * FROM Member"



I thought this ould get the data and store it in strSQL.

???

Shurik12
10-19-2004, 08:22 AM
no, you have to open an ADO recordset first (check the ADO tutorial in the FAQ section if needed)

sambase
10-19-2004, 09:12 AM
ok thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum