Run-time error 3356

G

Guest

Greetings,

I have a "novice" question in regards to opened databases. I am attempting
to execute the code below (in Outlook 2003) in order to read records from an
Access 2000 database. However, if the database has been opened by another
user (which is a distinct possibility), then I recieve the following error:

"Run-time error '3356': You attempted to open a database that is already
opened exclusively by user 'Admin' on machine 'EMPIRE100'. Try again when
the database is available."

Is it possible to read records from a database that is already opened?
Secondly, what is the best way to check and see if it is already opened.

Sub Application_Startup()
Dim myOlApp As Outlook.Application
Dim rs As DAO.Recordset
Dim wrkJet As DAO.Workspace

Set myOlApp = CreateObject("Outlook.Application")
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set db =
wrkJet.OpenDatabase("\\Server6\Company\Compliance\Licensing_Tables.mdb",
True) <-- Code fails here
....
 
A

Alex Dybenko

Hi,
perhaps you have database opened in exclusive mode. Look at access options
for default open mode. also you can choose mode in open database dialog
 
G

Guest

I used the code below and this works.

Set db =
wrkJet.OpenDatabase("\\Server6\Company\Compliance\Licensing_Tables.mdb",
False)
--
Thanks again!

Sherwood


Alex Dybenko said:
Hi,
perhaps you have database opened in exclusive mode. Look at access options
for default open mode. also you can choose mode in open database dialog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

problem with recordset 2
Tabledef problem 1
Help querying a table using VBA 4
Run Access query from Excel 2
VBA for access 4
OpenDatabase Working? 3
Opening recordsets in forms 1
Creating New Field Dynamically 1

Top