Disabling the read-only warning in Access

  • Thread starter Thread starter Dave Alger
  • Start date Start date
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
 
Dave said:
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.

Have you thought of making it an mde file and then you should not need
to make it read only.
 
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.
 
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
 
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.
 
Docmd.setwarnings (0) 'turns warnings off

it is important to turn them back on again though, so repeat the code above but with a 1 instead of a 0.

Samantha Rawson
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top