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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Query not returning RecordCount

Status
Not open for further replies.

abdullauthan

Programmer
Apr 20, 2000
64
SA
I am using a Stored Procedure with Dynamic SQL Statements in SQL Server. If try to retrieve records using the Stored Procedure in VB (ADO Command & Recordset combination), there are no records retrieved. However if I extract the result to a MSHFlexGrid
(Set MSHFlexGrid1.DataSource=rstTest)
I can get the results. Still the RecordCount property of the rescordset is -1. I can get the results in SQL Query Analyzer also. Any help on this?
 
By default, your recordset cursorlocation is adUseServer and your recordset cursortype is adOpenForwardOnly. This will return a -1 in the RecordCount Property. Set the cursorlocation to adUseClient or change the cursortype to adOpenStatic or better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top