Thank you, Douglas.
Well, the reason I ask is because in a former post I got a response that
executing the db.close when the db didn't actually "open" could cause the
database to do something haywire and run sluggish.
But from what I gather from your response, this would not be the case.
Also, a question about the "Persistent Recordset"
We have several FEs that linke to a single BE.
Each of these FEs load a Hidden Form at the AutoExec macro, and in the open
event of the form it instantiates a recordset to a linked table that is
linked to a "dummytable" in the BE.
This recordset is closed at the close event of the form.
Have you heard of this method before?
It is used to maintain good performance speed across all the FEs.
However, we are occasionally experiencing sluggish FE activity that is so
slow. An event takes over a minute, when it should just take about 4
seconds.
Would it be beneficial if we reset the persistent recordset once every 5
minutes on the hidden form's timer event? In other words, every five
minutes, the persistent recordset will die and re-establish.
Or, what about launching a hidden database from the windows startup folder
that instantiates the persistent recordset? That way, no matter how many
times the FEs are closed and re-opened, the persistent recordset will keep
the user logged into the LDB file.
What are your thoughts about this?
Anthony
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> In some of the earlier versions of Access (Access 1.0, 1.1 and, I think,
> 2.0), that could have caused problems.
>
> Newer versions are smart enough to know that you can't close a database if
> it's the current database.
>
> If it slows the application down, you'd need an extremely accurate
> stopwatch to notice the difference! <g>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "Anthony" <(E-Mail Removed)> wrote in message
> news:ueNyM$(E-Mail Removed)...
>> What will happen if I write this line:
>>
>> db.close
>>
>> in a sub procedure, when I didn't actually open the database?
>>
>> Example:
>>
>> Sub MyProc()
>>
>> Dim db as Database, rs as Recordset
>>
>> Set db = CurrentDb
>>
>> Set rs = db.OpenRecordset("MyTable")
>>
>> With rs
>> 'Do something
>> End With
>>
>> rs.Close
>> Set rs = Nothing
>>
>> db.Close
>>
>> Set db = Nothing
>>
>> End Sub
>>
>>
>> Notice the line: db.Close. Does this line need to be there? If not,
>> does the execution of this line cause the database to run slow?
>>
>
>