By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

How to close a DB ?

P: n/a
I have the following problem:

1-When I Try to compact my DB but I have the following error:

Error 3356 " You attempted to open a database that is already opened
exclusively by ‘Admin' on machine
‘xxxxx' . Try again when the database is available.

2-I Tryed to close the DB with this code but it does Not help.

Dim app As Access.Application
Set app = GetObject("c:\Mypath\MyDB.mdb")
app.DoCmd.Close
Set app = Nothing

3-I open the DB as Shared.

4- Only my self it is using such DB.

I do No know how to resolve this problem. Any help ???
Lots of thanks
Javier
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
First, you must have exclusive access to the database to compact it. If you
are sure that there is no one in the database, look in the database folder
for a *.ldb file where the first part of its name is the same as the name of
your database.

Example:
Database: MyDatabase.mdb
Lock File: MyDatabase.ldb

If no one is using the mdb file and the ldb file still exists, delete the
ldb file and try again.

--
Wayne Morgan
MS Access MVP
"Javier Gomez" <ja*****************@gmail.com> wrote in message
news:89**************************@posting.google.c om...
I have the following problem:

1-When I Try to compact my DB but I have the following error:

Error 3356 " You attempted to open a database that is already opened
exclusively by 'Admin' on machine
'xxxxx' . Try again when the database is available.

2-I Tryed to close the DB with this code but it does Not help.

Dim app As Access.Application
Set app = GetObject("c:\Mypath\MyDB.mdb")
app.DoCmd.Close
Set app = Nothing

3-I open the DB as Shared.

4- Only my self it is using such DB.

I do No know how to resolve this problem. Any help ???
Lots of thanks
Javier

Nov 13 '05 #2

P: n/a
Sorry for my delay answer I had some problems to conect again with this news.
Thank You !
"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<Fy***************@newssvr11.news.prodigy.com >...
First, you must have exclusive access to the database to compact it. If you
are sure that there is no one in the database, look in the database folder
for a *.ldb file where the first part of its name is the same as the name of
your database.

Example:
Database: MyDatabase.mdb
Lock File: MyDatabase.ldb

If no one is using the mdb file and the ldb file still exists, delete the
ldb file and try again.

--
Wayne Morgan
MS Access MVP
"Javier Gomez" <ja*****************@gmail.com> wrote in message
news:89**************************@posting.google.c om...
I have the following problem:

1-When I Try to compact my DB but I have the following error:

Error 3356 " You attempted to open a database that is already opened
exclusively by 'Admin' on machine
'xxxxx' . Try again when the database is available.

2-I Tryed to close the DB with this code but it does Not help.

Dim app As Access.Application
Set app = GetObject("c:\Mypath\MyDB.mdb")
app.DoCmd.Close
Set app = Nothing

3-I open the DB as Shared.

4- Only my self it is using such DB.

I do No know how to resolve this problem. Any help ???
Lots of thanks
Javier

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.