473,466 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Either open in exclusive mode or do not open at all:

I posted this last week, and did not receive a response. I thought I would
try one more time. Any help would be much appreciated.

Thanks
Bill

I have three databases running, all with a slightly different
function:

1) Shared Database where data entry is done
2) Data Inventory where information from the Shared Database is loaded
to throughout the day
3) Top Level database which grabs information from the inventory for
processing

Now, my dilema is that I use 'OpenCurrentDatabase strDB,TRUE' in
Database #3 to open up Database #2 exclusively to process information
and direct and run procedures on the data. That part is fine, as the
procedures automatically fire up when the database is open when I call
a macro in #2 from #3. The problem occurs when someone from #1 is
currently using #2, the OpenCurrentDatabase with the exclusive flag
sends a message that says:

Can't open for exlusive use
Will open the database for shared access.

It is the Will open the db for shared access that I need to stop.
Since the database opens and the macro fires up and starts running the
procedure. I actually want the OPEN to error out and kick me back to
#3

A couple thoughts ... check #2 if it's opened exclusively prior to
trying to open it, or is there a setting in #2 that would prevent
shared access if you attempt to get in with exclusive access.

Thanks
Bill
Nov 12 '05 #1
1 2734
sixsoccer wrote:
I posted this last week, and did not receive a response. I thought I would
try one more time. Any help would be much appreciated.

Thanks
Bill

I have three databases running, all with a slightly different
function:

1) Shared Database where data entry is done
2) Data Inventory where information from the Shared Database is loaded
to throughout the day
3) Top Level database which grabs information from the inventory for
processing

Now, my dilema is that I use 'OpenCurrentDatabase strDB,TRUE' in
Database #3 to open up Database #2 exclusively to process information
and direct and run procedures on the data. That part is fine, as the
procedures automatically fire up when the database is open when I call
a macro in #2 from #3. The problem occurs when someone from #1 is
currently using #2, the OpenCurrentDatabase with the exclusive flag
sends a message that says:

Can't open for exlusive use
Will open the database for shared access.

It is the Will open the db for shared access that I need to stop.
Since the database opens and the macro fires up and starts running the
procedure. I actually want the OPEN to error out and kick me back to
#3

A couple thoughts ... check #2 if it's opened exclusively prior to
trying to open it, or is there a setting in #2 that would prevent
shared access if you attempt to get in with exclusive access.

Thanks
Bill

I assume you know the path to the database #2, in which case you can
check for the existence of the ldb locking file, since you're using
macros there's not much you can do except have a condition column in the
macro but in VBA you'd do something like:

(air code)
Function OpenExclusive(pstrDatabase as string)
Dim strLDB as string
strLDB = left(pstrDatabase,len(pstrDatabase)-3) & "ldb"
If Len(Dir(strLDB)) Then
MsgBox "Our survey said - pzzzzzzzzt"
Else
' do your stuff here
End If
End function

--
But why is the Rum gone?
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chuck Van Den Corput | last post by:
I have encountered a problem that I am hoping someone can shed some light on. I have a multi-user A97 app. All users have a personal front-end MDE accessing a shared back-end. There is no...
0
by: Bill | last post by:
I have three databases running, all with a slightly different function: 1) Shared Database where data entry is done 2) Data Inventory where information from the Shared Database is loaded to...
0
by: Aaron | last post by:
Hi Guys, I have a dbase installed on a network where the clints have linked tables to the database on the server. I found that i had to make some minor changes to the tables on the server...
0
by: Wayne | last post by:
Can someone please help with this problem. When referring to opening a database in Exclusive mode the Access 2003 help says: "Under Default open mode, do one of the following: If you want others...
2
by: Javier Gomez | last post by:
How to open a linked table in exclusive mode from a FORM in DAO ??? (but,...... please I need it in DAO.) Thank you ! Javier Gomez
1
by: Frank Rizzo | last post by:
I am trying to open a file in exclusive mode for writing. Is the code below correct? FileStream oStream = File.Open(FileName, FileMode.Open, FileAccess.Write, FileShare.None); The purpose is...
2
by: Mat | last post by:
Or how to check if it's open in exclusive mode...? Thx
1
by: buclas | last post by:
Hi, I need to link a mdb file and make sure it opens in a non-exclusive mode. I looked for a similar post but none was answered. I know there is a specific param to add to the command line to...
6
by: =?Utf-8?B?RyBIdXN0aXM=?= | last post by:
I am creating a new MS Access DB in code, which works fine. I then try to open it & set a password. I keep getting an error that the DB is already open by my machine's Admin account. In reality it...
0
by: Salad | last post by:
A97. Split database. Frontend DB1.MDB. Backend DB1BE.MDB. Tables are linked between DB1 and DB2. From my testing, if I open DB1 exclusively using /excl the backend DB1BE is not opened...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.