473,769 Members | 7,745 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 2775
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
3259
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
2392
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
1988
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
3958
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
11505
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
6699
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
9579
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
10197
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
10032
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...
1
9977
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7391
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
6661
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
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
5432
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3947
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

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.