473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.developersdex.com ***
Nov 23 '05 #1
4 1310
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/en...mthrstopen.asp
http://msdn.microsoft.com/library/en...ortypeenum.asp
http://msdn.microsoft.com/library/en...cationenum.asp
http://msdn.microsoft.com/library/en...ecordcount.asp

Razvan

Nov 23 '05 #2
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.developersdex.com ***
Nov 23 '05 #3
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.developersdex.com ***


http://msdn.microsoft.com/library/de...ecordcount.asp
Nov 23 '05 #4
Eugene Anthony (so***********@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, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call...
4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
0
by: CFW | last post by:
I thought this was going to be easy but I'm missing something . . . I need to open an ADODB recordset using the recordset source for a list box on my for. When my form opens, the list box ADODB...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
0
ADezii
by: ADezii | last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.