Forums
This topic is locked
ADODB.Recordset (0x800A0BCD)
Posted 11 Sep 2006 16:30:45
1
has voted
11 Sep 2006 16:30:45 maha kalidas posted:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record./my web/userlogin.asp, line 21
this is my code
<% option Explicit
Dim objconn, objRS
Dim strcount
%>
<html>
<head>
</head>
<body>
<%
set objconn = Server.createObject("ADODB.Connection"
objconn.Open "DSN=maha"
set objRS = Server.createObject("ADODB.Recordset"
objRS.open "users3", objconn,adOpenDynamic, adLockReadOnly, adCmdText
while not objRS.BOF and NOT objRS.BOF
strcount = strcount + 1
objRS.moveNext
WEND
Response.write strcount
objRS.Close
objconn.Close
set objRS = nothing
set objconn = nothing
%>
can anyone help me out..?
Replies
Replied 12 Sep 2006 12:33:06
12 Sep 2006 12:33:06 Rob B replied:
Try changing this...
while not objRS.BOF and NOT objRS.BOF
...to this...
While Not objRS.EOF
while not objRS.BOF and NOT objRS.BOF
...to this...
While Not objRS.EOF