472,328 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

do i need to set objects to nothing

Hi Folk

I have about 1000 procedures in my project. Many, many of them are along
the lines of

function myfuntion () as boolean
on error goto er
'-
Dim Dbs as dao.database
Dim Rst as dao.recordset
Dim SqlS as string
'-
sqls = "..."
set dbs = currentdb
set rst = dbs.openrecordset(sqls)
do while not rst.eof
.....
rst.movenext
loop
'-
xt:
exit function
er:
msgbox error$
resume xt
end function
Should set dbs and rst to nothing or is that not necessary. If so, does
anyone know of an easy way to update all my procedures at once?

TIA

- Nicolaas
Nov 13 '05
106 5896
Trevor Best <no****@besty.org.uk> wrote in
news:42**********************@news.zen.co.uk:
David W. Fenton wrote:
You might have run into the "feature" where you have more than
one recordset variable set to .RecordsetClone, move one and it
moves the other.


Er, wouldn't that be the case in A97, too?


I haven't used that for about 6 years. :-)


Well, that was the subject of discussion, i.e., things that work in
A97 and can break when converted to A2K.
And, given the concept of what .RecordsetClone is supposed to be
*for*, isn't that the way you'd *want* it to work?


<fx: long sigh> That's why I mentioned it. It's more likely that
it's
that what happened to Steve than what he said (moving
recordsetclone moved the form as well, see below, that requires a
bit more effort)


I still don't get what the complaint is. It does what it's supposed
to do. It did it that way in A97, it appears to me to do the same
things in A2K.

Steve's problems appear to have come from incorrectly assuming that
using the new .Recordset object would work the same way as
..RecordsetClone. I don't see that this assumption was warranted at
all, but I can see that it's a logical possibility.

And, of course, it seems to me that it's yet another example of
where the introduction of the useless ADO has compromised basic
Access functionality.

As MichKa explains in his article, the change to ADO navigation in
the bookmark navigation wizard is caused by the desire to make the
code work in both MDBs and ADPs. That seems like a colossally stupid
goal to me, but, hey, what do I know?
I've never understood the use of recordset variables with
.RecordsetClone. What, exactly, are you accomplishing by doing
that, except complicating things?


Find feature on a form, e.g.

set rst = me.recordsetclone
rst.findfirst strCriteria
if rst.nomatch then
msgbox "not found"
else
me.bookmark = rst.bookmark
end if


With Me.RecordsetClone
.FindFirst strCriteria
If .nomatch then
msgbox "not found"
Else
Me.Bookmark = .Bookmark
End If
End With

Um, tell me again why you need to use a recordset variable?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #101
David W. Fenton wrote:
I still don't get what the complaint is. It does what it's supposed
to do. It did it that way in A97, it appears to me to do the same
things in A2K.
I wasn't complaining in the first place, I was pointing out a feature
that may catch someone out.

Um, tell me again why you need to use a recordset variable?


Force of habit.

--
[OO=00=OO]
Nov 13 '05 #102
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
David W. Fenton wrote:
I still don't get what the complaint is. It does what it's
supposed to do. It did it that way in A97, it appears to me to do
the same things in A2K.


I wasn't complaining in the first place, I was pointing out a
feature that may catch someone out.


But only if they don't understand how the object they are using is
supposed to work.
Um, tell me again why you need to use a recordset variable?


Force of habit.


The rule of thumb for me is that an object that you didn't create
doesn't necessarily need its own variable.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #103
David W. Fenton wrote:
I wasn't complaining in the first place, I was pointing out a
feature that may catch someone out.

But only if they don't understand how the object they are using is
supposed to work.


And everyone does?
The rule of thumb for me is that an object that you didn't create
doesn't necessarily need its own variable.


Although if you're already in a with block you can confuse things with
nested withs.

--
[OO=00=OO]
Nov 13 '05 #104
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
David W. Fenton wrote:
I wasn't complaining in the first place, I was pointing out a
feature that may catch someone out.


But only if they don't understand how the object they are using
is supposed to work.


And everyone does?


Well, that's pilot error, for whatever reason.

The point is, I don't see any evidence at all of Steve's original
assertion, that .RecordsetClone code that worked in A97 breaks in
A2K. The only case of that is stupidly trivial, if you write the
same code in an ADP. Since you can't convert an A97 MDB to an A2K
ADP, it really has nothing whatsoever to do with the topic of
discussion.
The rule of thumb for me is that an object that you didn't create
doesn't necessarily need its own variable.


Although if you're already in a with block you can confuse things
with nested withs.


Well, sure, but how often will you do that with the form's
RecordsetClone?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #105
David W. Fenton wrote:
But only if they don't understand how the object they are using
is supposed to work.


And everyone does?

Well, that's pilot error, for whatever reason.


That's the point. Otherwise there's no point in this group if everyone
who use it was an expert.

--
[OO=00=OO]
Nov 13 '05 #106
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
David W. Fenton wrote:
But only if they don't understand how the object they are using
is supposed to work.

And everyone does?


Well, that's pilot error, for whatever reason.


That's the point. Otherwise there's no point in this group if
everyone who use it was an expert.


Well, in the context of a thread about supposed *bugs* in
..RecordsetClone in A2K compared to A97, you can, I think, see why
I'd react to advice about pilot error as not too relevant.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #107

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bobby | last post by:
Hello everyone I have a question. The school I am working for is in the beginning process of having a webpage that will direct students to download...
2
by: Lin Ma | last post by:
Hello, I have a general question. In my asp page, I have DB connection, Recordset, and some variables like dim name, conn, rs set conn =...
16
by: Joel Finkel | last post by:
Folks, I am confused as to how to implement the following solution. I have a series of processing steps, each of which contains similar...
5
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one...
18
by: bsruth | last post by:
I tried for an hour to find some reference to concrete information on why this particular inheritance implementation is a bad idea, but couldn't. ...
4
by: Paul H | last post by:
A typical chunk of code...... Set db = CurrentDb Set rs = db.OpenRecordset("tblFoo") <Do some stuff here> 'How much of the stuff below do I...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.