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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GeryLuz
    New Member
    • Jul 2007
    • 4

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

    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:

    [code=asp]
    Set rs0 = cn.Execute ("Select Id_Fam from Familia where Descripcion = '"&perfil&"' ") ' RecorCount should be always 1

    sql = "Select Id_Usuario from Usu_Fam where Id_Fam = " & rs0("Id_Fam")
    set rs2 = cn.Execute(sql)

    sqo = "Select Nombre_Usuario, Nombre, Apellido, Telefono, Localidad, [E-Mail], Fecha from Usuarios where id = " & rs2("Id_Usuario ")
    Set rs1 = cn.Execute (sqo)

    response.write( rs0.RecordCount ) ' why -1?
    response.write( rs1.RecordCount ) ' why -1?
    response.write( rs2.RecordCount ) ' why -1?

    do while not rs1.eof ' It is showing only 1 record (The first one found)
    s = " <tr>"
    s = s & " <td align=center>"& rs1("Nombre_Usu ario")&"</td>"
    s = s & " <td align=center>"& rs1("Nombre")&" </td>"
    s = s & " <td align=center>"& rs1("Apellido") &" &nbsp;</td>"
    s = s & " <td align=center>"& rs1("Telefono") &"</td>"
    s = s & " <td align=center>"& rs1("Localidad" )&"</td>"
    s = s & " <td align=center>"& rs1("E-Mail")&"</td>"
    s = s & " <td align=center>"& rs1("Fecha")&"</td>"
    s = s & " <td align=center>"& perfil &"</td>"
    s = s & " </tr>"
    response.write s

    rs1.movenext
    loop[/code]
    Last edited by jhardman; Jul 30 '07, 09:43 PM. Reason: put code in code tags
Working...