[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ASP timeout on rs.movenext

Posted on 2004-04-06
4
Medium Priority
?
1,379 Views
Last Modified: 2012-05-04
Hi,
I'm trying to return a record set from a stored procedure on SQL Server7.  The app seems to to timeout and reports the failure at the include file where the line is ...
while (!rs.eof) { reccnt++; rs.movenext(); }
I have tracked it down to being the actual rs.movenext() line but can't find a way around it or why it's falling over.  The stored procedure works fine and returns results when running it asa query through Access in about 10 seconds.  Via asp it just hangs.  Can anyone help me please?
Thanks in advance.
0
Comment
Question by:PranP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 2000 total points
ID: 10765249
You can get the recordcount by using code like the following:

reccount = rs.recordcount

If it returns a value of -1 then you need to add this line before the recordset is created:
YourConnection.Cursorlocation = 3
0
 
LVL 15

Expert Comment

by:deighc
ID: 10765379
If all you want is a count of records from the database then use a SELECT COUNT(*) query.

This is alot faster than using the recordCount property of a the recordset object because you don't need a client-side static or keyset cursor (which are the slowest cursor types) and you only have a single record in your recordset.

In fact, if you're using a stored procedure and all you want to know is a record count then the absolute best performance will come by setting your record count as an output parameter of the stored procedure then using a command object to read the output parameter. That way you don't need a recordset object at all.
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10765381
What language?  C#?

Post more code..
0
 

Author Comment

by:PranP
ID: 10765653
Thanks Slimshaneey,
The YourConnection.CursorLocation did the trick.  Pulled back results stragiht away.

Many Thanks,
PranP
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question