| 
	
 | 
 Posted by Eugene Anthony on 06/15/28 11:32 
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 ***
 
  
Navigation:
[Reply to this message] 
 |