473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2732
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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,...

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.