Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: how to know does recordset exist


Message #1 by Greg Griffiths <greg.griffiths@g...> on Sun, 16 Jun 2002 19:46:25 +0100
--=====================_1004023==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

You could do something like :

set results = dbConn.execute("SELECT * FROM myTable")

if results.EOF then
         ' no data returned
else
         'data returned
end if

put your code in correctly, possibly even a boolean flag if needed.

At 16:52 15/06/02 +0100, you wrote:
>Hi
>I thought the following statement would solve this problem
>
>If IsObject(rsProperty) then
>     response.write rsProperty("ID")
>end if
>
>And it does work, but if I add option explicit at the top I will get error 
>message :-
>variable not defined
>
>Then if I define the variable first:-
>
>option explicit
>dim rsProperty
>If IsObject(rsProperty) then
>     response.write rsProperty("ID")
>end if
>
>and the recordset does exist I get error message:-
>Name redefined
>
>Can anybody help me?
>
>Kind Regards
>Oliver Dempsey
>
>==============================================
>Oliver Dempsey
><mailto:odempsey@b...>odempsey@b...
>www.barrowvale.com
>Barrowvale Technology Limited
>Web Solutions for Business
>Specialists in Dynamic Web Sites
>Domain Registration, Hosting, Design,
>SMS Text Messaging
>Statistics, Online Training
>Phone 00353 502 26263
>Fax     00353 502 26952
>Mobile 00353 86 8219430
>==============================================
>
>  This e-mail, and any attachment, is confidential. If you have received
>it in error, please delete it from your system, do not use or disclose
>the information in any way and notify me immediately.
>--- Improve your web design skills with these new books from Glasshaus. 
>Usable Web Menus 
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme 
>r-20 Constructing Accessible Web Sites 
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme 
>r-20 Practical JavaScript for the Usable Web 
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme 
>r-20 --- Change your mail options at http://p2p.wrox.com/manager.asp or to 
>unsubscribe send a blank email to 



Message #2 by Mark Eckeard <meckeard2000@y...> on Sat, 15 Jun 2002 09:45:00 -0700 (PDT)
Use this function to return true (exists) or false
(doesn't exist):

Function IsEmptyRecordset(RecordsetToCheck)
'this function checks the recordset for several ways
of being "blank"

'and returns the findings
On Error resume next

'our return variable
Dim boolReturn

'make sure that the recordset isn't a "Nothing" object
If RecordsetToCheck Is Nothing Then
boolReturn = True
ElseIf RecordsetToCheck.BOF And RecordsetToCheck.EOF
Then
boolReturn = True
Else
boolReturn = False
End If


if Err.number <> 0 then
      Err.Clear
            boolReturn = true
      end if

    IsEmptyRecordset = boolReturn

End Function

 

Mark.
--- odempsey@b... wrote:
> Hi
> I thought the following statement would solve this
> problem
> 
> If IsObject(rsProperty) then 
>     response.write rsProperty("ID")
> end if
> 
> And it does work, but if I add option explicit at
> the top I will get error message :-
> variable not defined
> 
> Then if I define the variable first:-
> 
> option explicit 
> dim rsProperty
> If IsObject(rsProperty) then 
>     response.write rsProperty("ID")
> end if
> 
> and the recordset does exist I get error message:-
> Name redefined 
> 
> Can anybody help me?
> 
> Kind Regards
> Oliver Dempsey
> 
> ==============================================
> Oliver Dempsey
> odempsey@b...
> www.barrowvale.com
> Barrowvale Technology Limited
> Web Solutions for Business
> Specialists in Dynamic Web Sites
> Domain Registration, Hosting, Design, 
> SMS Text Messaging
> Statistics, Online Training
> Phone 00353 502 26263
> Fax     00353 502 26952
> Mobile 00353 86 8219430
> ==============================================
>  
>  This e-mail, and any attachment, is confidential.
> If you have received
> it in error, please delete it from your system, do
> not use or disclose
> the information in any way and notify me
> immediately. 
> 
> 
> 
> ---
> 
> Improve your web design skills with these new books
> from Glasshaus.
> 
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
Message #3 by <odempsey@b...> on Sat, 15 Jun 2002 16:52:04 +0100
This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C2148C.F9EC8700
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi
I thought the following statement would solve this problem

If IsObject(rsProperty) then
    response.write rsProperty("ID")
end if

And it does work, but if I add option explicit at the top I will get 
error message :-
variable not defined

Then if I define the variable first:-

option explicit
dim rsProperty
If IsObject(rsProperty) then
    response.write rsProperty("ID")
end if

and the recordset does exist I get error message:-
Name redefined

Can anybody help me?

Kind Regards
Oliver Dempsey

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Oliver Dempsey
odempsey@b...
www.barrowvale.com
Barrowvale Technology Limited
Web Solutions for Business
Specialists in Dynamic Web Sites
Domain Registration, Hosting, Design,
SMS Text Messaging
Statistics, Online Training
Phone 00353 502 26263
Fax     00353 502 26952
Mobile 00353 86 8219430
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

 This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way and notify me immediately.



  Return to Index