database - Asp-Classic ADODB Recordset missing Records -


one of simplest components in website stopped working 1 day other without changes in code.

'connection declaration connection set rs = server.createobject ("adodb.recordset") rs.open "select * tablename order id desc", connection, 1, 3 while not rs.eof   'writing table records in db   'simplified code %>   <tr><td><%=rs("id")%></td><td><%=rs("description")&></td></tr>   <%   rs.movenext wend 

in database have verified extraordinary number of 30 records :(

when above code executed see 2 of them

this tells me 2 things,

first: tablename correct , connection database established
second: table-generation in correct

i have smaller testing-system. there exact same code on sample database produces expected results.

unfortunately have no means of "instant-access" main page "debugging purposes"

is there known bugs adodb recordsets losing records? please keep in mind code same , working "error-free".

a few suggestions.

use option explicit if not - (i didn't see in code) display sql errors, may help.

check haven't destroyed rs.

also, "connection, 1, 3" means 'active connection', 'cursortype', 'locktype'

your cursortype 'adopenkeyset' - 3 or 'adopenstatic' better, unless want keyset? try calling open way force defaults (which oddly enough 3 , 1 respectively !) :

rs.open "select * tablename order id desc",connection  

i write rs output loops :

if not rs.bof    ' write table tag html    while not rs.eof       ' write table row + row data       rs.movenext    loop    ' write end table tag html else    ' write "rs empty!" end if 

this make easier tell if recordset empty or not.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -