Click to See Complete Forum and Search --> : Record Count -1


shanuragu
06-18-2003, 04:29 AM
When I use the following code to fetch records

For i=0 To UBound(a)
strsql = "SELECT * from CdPrice Where CountryId="&ConId&" And CdTitleId="&a(i)&""
Response.write("query" & strsql & "<br>")
Set RsCdPrice=Con.Execute(strsql)
'RsCdPrice.open strsql,Con,adlockoptimistic,adcmdtable
Next

& text for record count it will always be -1 why????

ShaRa

cmelnick
06-18-2003, 09:25 AM
I have had the same problem (using ADO)...Read why... (http://support.microsoft.com:80/support/kb/articles/Q194/9/73.ASP&NoWebContent=1)

shanuragu
06-18-2003, 09:42 AM
I did change the lock & cursor type combination for which i got the following error

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/lila/asp/orderdetails.asp, line 76

ShaRa
:mad:

cmelnick
06-18-2003, 02:09 PM
I'm not sure. It probably depends somewhat on server settings, etc. Why not do something simple like:

count = 0
Do Until rstOrders.EOF Or rstOrders.BOF

count = count + 1
rstOrders.MoveNext

Loop

It is quick enough, and will do what you need...I haven't really played w/ lock & cursor types because my host doesn't play nice with that stuff, so I am forced to use the above count code.