Loosing exclusive rights with DAO code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

after executing this:

Dim db As Database
Dim dbExt As Database

Set db = CurrentDb()
Set dbExt = OpenDatabase("C:\backend.mdb")

db.Close
dbExt.Close

Access says the current db is no longer opened in exclusive mode.

Is that a bug ?
 
Henry said:
after executing this:

Dim db As Database
Dim dbExt As Database

Set db = CurrentDb()
Set dbExt = OpenDatabase("C:\backend.mdb")

db.Close
dbExt.Close

Access says the current db is no longer opened in exclusive mode.

Is that a bug ?


I don't know, never seen that before.

However, technically, since you did not open CurrrentDb, you
should not try to close CurrentDb. We have been assured(?)
that it doesn't do anything, but ...

OTOH, it may(?) be important to set the object variables to
Nothing.

I seriously doubt it will solve your problem, but the
recommended code is:
Set db = Nothing
dbExt.Close : Set dbExt = Nothing
 
yes, I need to drink more coffee too ;-)

Marshall Barton said:
I don't know, never seen that before.

However, technically, since you did not open CurrrentDb, you
should not try to close CurrentDb. We have been assured(?)
that it doesn't do anything, but ...

OTOH, it may(?) be important to set the object variables to
Nothing.

I seriously doubt it will solve your problem, but the
recommended code is:
Set db = Nothing
dbExt.Close : Set dbExt = Nothing
 
Back
Top