"Stephen sjw_ost" <(E-Mail Removed)> wrote in message
news:05D8CBE7-EB19-436F-9569-(E-Mail Removed)...
> Hello, thanks for everyones help in the past. I've got another question
> for ya.
>
> Is there a way to ensure a frontend DB is NOT opened in exclusive mode
> except by me or another authorized admin? The permissions part I beleive I
> have, it's the setting of "Open Exclusive" vs "Open" I am needing help
> with.
> Side note; I do not want it to be opened read-only either. Just "Open" by
> a
> user.
>
> What I am looking for, if it can be done, is a user opens my FE DB and can
> use it as intended but I can come in and "Open Exclusive", if needs be.
> Kind of like having an Excel file in shared mode. One user can make a
> change
> to the Excel file and save, once the other users click save on their own
> PC
> they can see the update or change that was made.
> Can access do this? Can multiple users have the DB "Open", I come in and
> "Open Exclusive", make a change, save and the other users see the change
> via
> an update timer or update button?
I agree with Piet that it's a bad idea to share your front-end across the
network. More on that below.
To answer your first question, you can find out whether the database is
currently opened exclusive by trying to open it again. Here's code for a
function to determine whether the database is currently opened exclusive:
'----- start of code -----
Function IsDBOpenedExclusive(stDbName As String) _
As Boolean
On Error Resume Next
Dim dbe As DBEngine
Dim db As Database
Set dbe = New PrivDBEngine
Set db = dbe.OpenDatabase(stDbName)
' If the database failed with error 3045,
' it was opened exclusively by someone else
' or possibly by ourselves.
IsDBOpenedExclusive = (Err.Number = 3045)
' Close up the db in case we opened it.
If Not (db Is Nothing) Then
db.Close
End If
Set dbe = Nothing
End Function
'----- end of code -----
I don't know where I got that code; I don't think I wrote it, but I've had
it so long I don't remember who did.
Now, about sharing the front-end: this was not such a bad idea in Access
97, at least if the network was in good shape, because relatively little of
the front-end was sent backl across the network in A97. Back then, each
code module could be updated and saved separately, and there was less
"state" to be saved in the front-end. Access 2000 introduced a new
"monolithic" VB project, such that saving any code changes involved saving
the entire project. This design continues in all subsequent versions.
Also, I believe there are many more things about the front-end that are
automatically updated these days, whenever the front-end is used. All this
means that, if your front-end is shared, there will be much more updating of
the front-end database file across the network. That means more exposure to
network corruption. If your network is rock-solid, that may not affect you,
but we see a lot more database corruption these days than we used to back in
the days of Access 97, and a lot of it can be attributed to sharing the
front-end.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)