vba opendatabase readonly

L

Laursen.Aarup

The following code does not open my frontend in the same way as an open as
readonly by manual method!

If sUser <> "jrla" Then
'Set user privilege
Dim db As Database
Set db = OpenDatabase(CurrentProject.Path & "\IOFE.accdb", False, True)
Application.CurrentDb.Close
End If

Only the form(s) are protected?

Isn't it possible to open the entire database as readonly by the use of vba
code?

kind regards Jan
 
T

Tom van Stiphout

On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup

Simply create a shortcut like this:
<path_to>msaccess.exe <path_to>iofe.accdb /readonly

-Tom.
Microsoft Access MVP
 
L

Laursen.Aarup

Hi Tom

That didn't really answer my question! Anyone can open the FE directly from
the folder! I want to secure the total design if a user other than someone
specified by me wants to open the database.

I would also like to ensure the data like opening the BE read-only. Is this
possible by vba code?

Kind regards Jan
 
T

Tom van Stiphout

On Tue, 13 Jan 2009 01:06:04 -0800, Laursen.Aarup

You wrote: "Anyone can open the FE directly from the folder"
And when you use VBA wizardry they can't?

If you want the BE to be readonly, put it on a readonly shared drive.
I can't imagine why you would want the FE to be readonly. I'm assuming
you already compiled it to a .accde file. But if you must, put it on a
readonly share as well. Remember that this will be a non-standard
deployment and you may suffer negative side-effects because of it.

What is it you are really trying to accomplish? If we understood
better, we might be able to suggest alternatives.

-Tom.
Microsoft Access MVP
 
L

Laursen.Aarup

Hi Tom

Okay I see your point. I'm working on a conversion of a 2003 to a 2007 so
that I'll be able to make the FE a accde file.

kind regards Jan
 
L

Laursen.Aarup

One more thing... Some users must be able to write (to BE) and perhaps even
alter the FE! This is my reason to use the vba code to give permissons!
 
T

Tom van Stiphout

On Tue, 13 Jan 2009 21:58:00 -0800, Laursen.Aarup

Writing to the BE: give those users read/write access to the shared
drive.
Alter the FE: that means they are part of the development team. They
work with the accdb just like you are, towards a new version of the
product. At some point you integrate everyones work into a new
version, make it available for beta testing, and upon approval deploy
it as accde to everyone. There is a discipline to software
development.
If people need the ability to create ad-hoc queries and other objects,
they can use their own accdb, linking to the same BE.

-Tom.
Microsoft Access MVP
 

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

Top