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 wOOdy-Soft 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?
 
Dear
the RecordSet u r opening is Forward only which give u -1 for RecordCount Property try to open it of other type like
adoopenstatic
Lik
Rs.Open "Select * from sometbale",adopenstatic
u will get correct recordcount
Regards
Nouman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top