473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 6333
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 there homework and be able to view there info...
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 = Server.CreateObject("ADODB.Connection") .... set rs=...
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 features (forms, etc). Therefore, I create a base...
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 please help me with this? static public...
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. So I'm sorry if this has been answered before....
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 need? 'Do I need to close the recordset?...
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 can't reopen database after exiting as a result...
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 rather long post, and I hope I have enough details that...
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 mix-in class called Threadable. Then when an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.