Re: How to determine if object (recordset) is set?
From: Michael Thompson (thommo_at_pobox.com)
Date: 06/23/04
- Next message: Derek: "Creating ADO recordset from a text file"
- Previous message: Veign: "Re: Multiple Values in One Field"
- In reply to: Mark J. McGinty: "Re: How to determine if object (recordset) is set?"
- Next in thread: Mark J. McGinty: "Re: How to determine if object (recordset) is set?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 23:40:52 -0700
Mark, you are not entirely correct that comparing an object to nothing
does not alter the object. It depends on how the object is declared.
Consider the following:
dim rs as new adodb.recordset
set rs = nothing 'rs is already nothing, but it can't hurt
if rs is nothing then
debug.print "rs is nothing"
else
debug.print "rs is NOT nothing"
endif
And surprise surprise the output is "rs is NOT nothing". Why? Because
the variable was declared "rs as NEW adodb.recordset". This causes every
reference to rs to check if it is currently nothing and if so, go off
and create one.
Bottom line is that the "as new" syntax for declaring an object variable
should NEVER be used. It is inefficient and totally unnecessary.
Mike.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Derek: "Creating ADO recordset from a text file"
- Previous message: Veign: "Re: Multiple Values in One Field"
- In reply to: Mark J. McGinty: "Re: How to determine if object (recordset) is set?"
- Next in thread: Mark J. McGinty: "Re: How to determine if object (recordset) is set?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|