|
 |
asp_databases thread: Re: Why doesnt my string work?
Message #1 by "Ken Schaefer" <ken@a...> on Tue, 21 May 2002 12:07:18 +1000
|
|
<%
If not objRS.EOF then
' There are records
Else
' There are no records
End If
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "SD-Studios" <info@s...>
Subject: [asp_databases] Why doesnt my string work?
: Im using this string to see if the Recordset is EOF or not. But it doesnt
: work =(
:
: If Not(objRS.EOF) Then
:
: Here's the error I get:
: Either BOF or EOF is True, or the current record has been deleted.
Requested
: operation requires a current record.
:
: I know theres nothing wrong with the code, so it has to be the If-string
: that doesnt work.. Please help me out! Thnx!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #2 by <marcus@p...> on Mon, 20 May 2002 20:31:14 +0100
|
|
Try:
if not (objRs.eof and objRs.bof) then
This checks to see if any records at all are returned.
Marcus
----- Original Message -----
From: "SD-Studios" <info@s...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, May 20, 2002 8:14 PM
Subject: [asp_databases] Why doesnt my string work?
> Im using this string to see if the Recordset is EOF or not. But it doesnt
> work =(
>
> If Not(objRS.EOF) Then
>
> Here's the error I get:
> Either BOF or EOF is True, or the current record has been deleted.
Requested
> operation requires a current record.
>
> I know theres nothing wrong with the code, so it has to be the If-string
> that doesnt work.. Please help me out! Thnx!
> --
> MVH, Martin Johansson
> CEO & Project Supervisor
> SD-Studios
> +46 (0)70-3003320
> http://www.sd-studios.com
>
>
>
>
Message #3 by "SD-Studios" <info@s...> on Mon, 20 May 2002 21:14:11 +0200
|
|
Im using this string to see if the Recordset is EOF or not. But it doesnt
work =(
If Not(objRS.EOF) Then
Here's the error I get:
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
I know theres nothing wrong with the code, so it has to be the If-string
that doesnt work.. Please help me out! Thnx!
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com
Message #4 by "Owen Mortensen" <ojm@a...> on Mon, 20 May 2002 12:27:56 -0700
|
|
You're assuming that the "set objRS = "<ADOOBJECTEXEC> worked. If there
was a failure there, then there may not be a current record and the EOF
check will fail. What are the lines just before the if statement?
Owen
-----Original Message-----
From: SD-Studios [mailto:info@s...]
Sent: Monday, May 20, 2002 12:14 PM
To: ASP Databases
Subject: [asp_databases] Why doesnt my string work?
Im using this string to see if the Recordset is EOF or not. But it
doesnt work =(
If Not(objRS.EOF) Then
Here's the error I get:
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
I know theres nothing wrong with the code, so it has to be the If-string
that doesnt work.. Please help me out! Thnx!
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com
Message #5 by "Drew, Ron" <RDrew@B...> on Mon, 20 May 2002 18:34:24 -0400
|
|
if oRs.BOF and oRs.EOF then
' NO ROWS
' Output something firm but polite.
else
oRs.MoveFirst ' Just to be sure.
while not oRs.EOF ' While there are more records
' Do stuff with a row here
ors.movenext ' Go to the next record, or set EOF if no more
records.
wend
end if
-----Original Message-----
From: SD-Studios [mailto:info@s...]
Sent: Monday, May 20, 2002 3:14 PM
To: ASP Databases
Subject: [asp_databases] Why doesnt my string work?
Im using this string to see if the Recordset is EOF or not. But it
doesnt work =3D(
If Not(objRS.EOF) Then
Here's the error I get:
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
I know theres nothing wrong with the code, so it has to be the If-string
that doesnt work.. Please help me out! Thnx!
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com
Message #6 by imran.saleem@b... on Tue, 21 May 2002 10:10:28 +0100
|
|
IF objRS.EOF THEN
objRS.MoveFirst
END IF
-----Original Message-----
From: SD-Studios [mailto:info@s...]
Sent: Monday, May 20, 2002 8:14 PM
To: ASP Databases
Subject: [asp_databases] Why doesnt my string work?
Im using this string to see if the Recordset is EOF or not. But it doesnt
work =(
If Not(objRS.EOF) Then
Here's the error I get:
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.
I know theres nothing wrong with the code, so it has to be the If-string
that doesnt work.. Please help me out! Thnx!
--
MVH, Martin Johansson
CEO & Project Supervisor
SD-Studios
+46 (0)70-3003320
http://www.sd-studios.com
|
|
 |