By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,639 Members | 1,988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,639 IT Pros & Developers. It's quick & easy.

Why RecordCount shows me a -1 an only 1 record is found??

P: 4
Hi !!

I have a problem showing a users table in an ASP page.
It shows me only one record when i checked that there are more than one in my table.
But when i print the RecordCount property of each recordset all of them show me a -1.
What is happening?? :(
Please, help!!
Here is the code:

Expand|Select|Wrap|Line Numbers
  1. Set rs0 = cn.Execute ("Select Id_Fam from Familia where Descripcion =  '"&perfil&"'")  ' RecorCount should be always 1
  2.  
  3. sql = "Select Id_Usuario from Usu_Fam where Id_Fam = " & rs0("Id_Fam")
  4. set rs2 = cn.Execute(sql) 
  5.  
  6. sqo = "Select Nombre_Usuario, Nombre, Apellido, Telefono, Localidad, [E-Mail], Fecha from Usuarios where id = " & rs2("Id_Usuario")      
  7. Set rs1 = cn.Execute (sqo)
  8.  
  9. response.write(rs0.RecordCount) ' why -1?
  10. response.write(rs1.RecordCount) ' why -1?
  11. response.write(rs2.RecordCount) ' why -1?
  12.  
  13. do while not rs1.eof   ' It is showing only 1 record (The first one found)
  14.     s = " <tr>"
  15.     s = s & "    <td align=center>"& rs1("Nombre_Usuario")&"</td>"
  16.     s = s & "    <td align=center>"& rs1("Nombre")&"</td>"
  17.     s = s & "    <td align=center>"& rs1("Apellido")&" &nbsp;</td>"
  18.     s = s & "    <td align=center>"& rs1("Telefono")&"</td>"
  19.     s = s & "    <td align=center>"& rs1("Localidad")&"</td>"
  20.     s = s & "    <td align=center>"& rs1("E-Mail")&"</td>"
  21.     s = s & "    <td align=center>"& rs1("Fecha")&"</td>"
  22.     s = s & "    <td align=center>"& perfil &"</td>"
  23.     s = s & "    </tr>"
  24.     response.write s
  25.  
  26.     rs1.movenext
  27. loop
Jul 28 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.