I have inherited a lot of code that is essentially like this:
dim dbs as dao.database
set dbs = currentdb()
dbs.execute "Some SQL string"
set dbs = nothing
Is there any reason not to recode it as:
currentdb().execute "some SQL string"
(I know that if I want to use .recordsaffected, currentdb().recordsaffected won't yield usable results).
Are there any benefits from recoding it, other than simplifying the code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…