Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Recordset
This asp code displayes records in a combo box:


<%
openDB()

call updateDB("usp_retrieveOptions",rs)

if not rs.eof then

%>
<tr>
<td width="66">Options</td>
<td width="137">
<select name="select1" class="TextField1">
<%
i = 0

do while not rs.eof

if rs(0) <> Arr(i) then
response.write "<option value=" & rs(0) & ">" & rs(1)
i = i + 1
end if

rs.movenext

loop
%>
</select>
</td>
</tr>
<tr>
<td colspan="2" width="206">
<center>
<table width="71" border="0" cellspacing="3" cellpadding="0"
height="33">
<tr>
<td width="9" height="30">
<input type="submit" name="Assign" value="Assign"></td>
</tr>
</table>
</center>
</td>
</tr>
<%
end if

closeRS()
closeDB()
%>



The call updateDB("usp_retrieveOptions",rs) invokes

sub updateDB(SQL,rs)

set rs = objConn.Execute(SQL)

end sub


and my usp_retrieveOptions stored procedure:

create procedure usp_retrieveOptions
AS SET NOCOUNT ON

SELECT OptionID, Description FROM Options

Return
GO


now in my asp code when I try response.write rs.RecordCount I am getting
-1 all the time. How do I solve the problem. Your help is kindly
appreciated.



Eugene Anthony

*** Sent via Developersdex http://www.droptable.com ***

Report this thread to moderator Post Follow-up to this message
Old Post
Eugene Anthony
11-19-05 08:23 AM


Re: Recordset
Hi, Eugene

For some answers to your question, see:
http://www.aspfaq.com/show.asp?id=2193

Also, you can try to specify different options for CursorType (e.g.
adOpenStatic=3) or CursorLocation (e.g. adUseClient=3).
For more informations, see:
http://msdn.microsoft.com/library/e...dmthrstopen.asp
http://msdn.microsoft.com/library/e...sortypeenum.asp
http://msdn.microsoft.com/library/e...recordcount.asp

Razvan


Report this thread to moderator Post Follow-up to this message
Old Post
Razvan Socol
11-19-05 08:23 AM


Re: Recordset
I did this:


Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Exec usp_retrieveOptions",objConn,1,1
response.write rs.RecordCount

and im still getting -1


Eugene Anthony

*** Sent via Developersdex http://www.droptable.com ***

Report this thread to moderator Post Follow-up to this message
Old Post
Eugene Anthony
11-19-05 08:23 AM


Re: Recordset
Eugene Anthony  wrote:
> I did this:
>
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open "Exec usp_retrieveOptions",objConn,1,1
> response.write rs.RecordCount
>
> and im still getting -1
>
>
> Eugene Anthony
>
> *** Sent via Developersdex http://www.droptable.com ***

http://msdn.microsoft.com/library/d...
ecordcount.asp

Report this thread to moderator Post Follow-up to this message
Old Post
Trevor Best
11-19-05 12:23 PM


Re: Recordset
Eugene Anthony  (solomon_13000@yahoo
.com)  writes:
> I did this:
>
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open "Exec usp_retrieveOptions",objConn,1,1
> response.write rs.RecordCount
>
> and im still getting -1

Do you set the cursor location anywhere? The .CursorLocation is a
property on the connection object. Set it to adUseClient.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
11-21-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 04:00 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006