By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.