473,322 Members | 1,409 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,322 software developers and data experts.

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:

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
0 1090

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

Similar topics

8
by: middletree | last post by:
I'm simply trying to get a number of records returned in a recordset, and just get a -1. I have looke din a few books and other references, can't seem to find any answers. Anyone have any idea why...
6
by: Mark Watkins | last post by:
I know for a fact that in my database, I have three records under the users table. However when I execute this code: --------------BEGIN CODE---------------- Set objConn =...
7
by: Serge Myrand | last post by:
Hi, I have an ADODB.RecordSet that RecordCount alway return -1 and this RecordSet is plenty of record! R.RecordSet = -1 R.eof = False R.BOF = False Is the cursor is lost somewhere?
5
by: michael montagne | last post by:
Problem with this statement: sSQL = "SELECT * FROM Projects;" Set oDbe = CreateObject("DAO.DBEngine.36") oDbe.SystemDB = "myworkgrupfile.MDW" Set oWS = oDbe.CreateWorkspace("", "me", "") Set oDB...
4
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting...
2
by: Dayron | last post by:
I discovered that my asp code retrieve the record from the database and I wish to get the recordcount of the record. Unfortunately, I always get -1 instead of the correct record count. I have...
2
by: ChasW | last post by:
I am trying to get a correct recordcount from a recordset that references a linked table as the source. Here is the code: Dim db1 As DAO.Database Dim rs1 As DAO. Recordset Set db1 =...
2
by: rajvbprogramer | last post by:
here is my problem. i have two records. one containing 20 records and second containing 30 records. now i want the recordcount property to use and go to the 21 record. i m calculating the...
3
by: prigupta2 | last post by:
Hello Friends, vb6.0 i want to add only 4-record in the table IF record is greater then or equal then 4 then i want to show message and Main_frm.Login_mnu.Enabled = False code i use: Set...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.