Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid plz. HELP !!!!!!!!1

Status
Not open for further replies.

ctudose

Programmer
Nov 22, 2001
33
0
0
CA
I have an Access97 db & ABC a query
I use the following code code to display the results into an MSHFlexGrid.
Why is it displayed JUST the first record ????
What is it wrong ???


Private Sub cmdReport_Click()

Dim rs As ADODB.Recordset
Dim cmdobj As ADODB.Command


Set rs = New ADODB.Recordset
Set cmdobj = New ADODB.Command

With cmdobj
.ActiveConnection = cnx
.CommandText = "ABC"
.CommandType = adCmdStoredProc
End With




Set rs = cmdobj.Execute()

Set Me.MSHFG.DataSource = rs



End Sub
 
What is your stored proceudre, what does it return in Access? Thanks and Good Luck!

zemp
 
the problem is that Execute method return a recordset which is by default adOpenForwardOnly and I think here is the problem- for Access97;
For a sql stored procedure it works.
So, to solve the problem I had to use the Open method
Anyway, thanks
Regards,
cris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top