Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recordset types and stored procedures
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00597088
Message ID:
00597137
Views:
18
>I had a sql statement that returned one row from my sql server. In my asp I used to test weather there were records returned by checking the the recordcount property, it would be >= 1 if records were returned. Like this...
>
>strQuery = "select id from sometable"
>objRS.open strQuery, objConn, adOpenStatic, adLockReadOnly
>
>
>Now, I made the query a stored procedure and use it like this...
>
>strQuery = "spname '" & strparam1& "', " & intparam2
>set objRS= objConn.execute(strQuery, intRecsAffected, adCmdText)
>
>And everytime the recordcount property returns -1. I did some research and found out this is because the cursortype is default set to forwardonly, which dosent allow a recordcounts. So I added the intRecsAfffected variable figuring I could just test that. Well, this returns 0 when it dosent select any records, thats good, but when it does select a record it is -1 just like the recordcount property.
>
>Any ideas on how I can set this up with minimal complexity. The SP is a simple select statement and I dont want to do any modifications to it.
>
>Thanks in advance,
>Eric

Set the connection object's cursorlocation property to adUseClient before opening and that should make it return a static recordset that will have the recordcount populated. HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform