Disabling the read-only warning in Access

D

Dave Alger

Hi,

For various reasons I've decided to try making the front-end database a
read-only file (through Windows). It works fine, the only irritation is that
when the database is started it warns the user that the database is
read-only etc

It's unnecessary (and gives the impression they cannot work on the DB). Is
there any way of disabling this message? (other than taking the file off
read-only status?)

Thanks in advance for any help.

Regards,
Dave
 
D

Douglas J. Steele

Joseph Meehan said:
Have you thought of making it an mde file and then you should not need
to make it read only.

Sometimes you want a "true" read-only application, to make sure that the
user can't change the data. (Think of a catalog or price list). An MDE won't
help in that case.

Dave: I've never found a reliable way of preventing the read-only message.
You're supposed to be able to prevent it by starting, say, a VB program and
using Automation to open the Access application, but that's not really a
satisfactory answer in my opinion.
 
D

Dave Alger

Hi Doug,

Thanks. It's good to know if it's not really possible before I go mad
trying to get it to work!

I agree that the solution is less than satisfactory. If I was going to add
a VB app I'd do my whole Frontend in VB.

regards,
Dave
 
A

Andi Mayer

Hi,

For various reasons I've decided to try making the front-end database a
read-only file (through Windows). It works fine, the only irritation is that
when the database is started it warns the user that the database is
read-only etc

It's unnecessary (and gives the impression they cannot work on the DB). Is
there any way of disabling this message? (other than taking the file off
read-only status?)
you could use something like this:

Sub SetReadOnly(Optional SetIt As Boolean)
Dim FS, F
Set FS = CreateObject("Scripting.FileSystemObject")
Set F = FS.GetFile(CurrentDb.Name)
F.Attributes = IIf(SetIt, vbReadOnly, vbNormal)
Set F = Nothing
Set FS = Nothing
End Sub

on start you set it and on close you reset it.

This works only for one user and if due to some reason you don't reset
it the user get's the warning on the next open, but then it will be
reset again.
 
D

Douglas J. Steele

Andi Mayer said:
you could use something like this:

Sub SetReadOnly(Optional SetIt As Boolean)
Dim FS, F
Set FS = CreateObject("Scripting.FileSystemObject")
Set F = FS.GetFile(CurrentDb.Name)
F.Attributes = IIf(SetIt, vbReadOnly, vbNormal)
Set F = Nothing
Set FS = Nothing
End Sub

on start you set it and on close you reset it.

This works only for one user and if due to some reason you don't reset
it the user get's the warning on the next open, but then it will be
reset again.

Sometimes that's not feasible, Andi. For instance, we often put our
read-only databases in a read-only folder.
 
Top