473,776 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
+ 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 'OpenCurrentDat abase 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 OpenCurrentData base 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 2777
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 'OpenCurrentDat abase 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 OpenCurrentData base 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(p strDatabase as string)
Dim strLDB as string
strLDB = left(pstrDataba se,len(pstrData base)-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
3261
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 specific MDW file for the app as security rules are housed within the app itself. On a couple of occasions, different users have launched the app only
0
355
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 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
0
2394
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 where the client databases look to for their data after I made the changes I tried to open one of the clients databases and found that I was getting an error 3051 open exclusive where when the client tries to connect to the tables on the server it...
0
1989
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 to be able to open the Microsoft Access database at the same time you have it open, click Shared. If you want sole access to the Access database when you have it open, click Exclusive." >From my experience and from what I have read on the...
2
3960
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
11507
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 two-fold: 1. I want no one to be able to open a file while I am operating on it. 2. If the file is open by someone else, I want the code above to throw an exception.
2
6700
by: Mat | last post by:
Or how to check if it's open in exclusive mode...? Thx
1
3692
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 get the mdb to open in exclusive mode (/excl). I'm looking for the exact opposite.
6
4726
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 is not actually open. Here is a look at my code for creating & then setting the Password. Dim ADOXcat As New ADOX.Catalog sCreateString = "Provider=" & Provider & ";Data Source=" & DatabaseFullPath Try ADOXcat.Create(sCreateString)
0
4970
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 exclusively. If I open DB1 but have no tables open and then open up DB1BE exclusively, DB1BE will open exclusive. But if I then attempt to open a linked table in the frontend DB1 I'm informed I can't use the table because the file is in use.
0
9627
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10287
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9922
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7469
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5367
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5492
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4030
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3621
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.