Home All Groups Group Topic Archive Search About

vba opendatabase readonly

Author
12 Jan 2009 6:13 AM
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

Author
12 Jan 2009 2:02 PM
Tom van Stiphout
On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
<Laursen.Aa***@discussions.microsoft.com> wrote:

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

-Tom.
Microsoft Access MVP


Show quoteHide quote
>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
Are all your drivers up to date? click for free checkup

Author
13 Jan 2009 9:06 AM
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

Show quoteHide quote
"Tom van Stiphout" wrote:

> On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
> <Laursen.Aa***@discussions.microsoft.com> wrote:
>
> Simply create a shortcut like this:
> <path_to>msaccess.exe <path_to>iofe.accdb /readonly
>
> -Tom.
> Microsoft Access MVP
>
>
> >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 
>
Author
14 Jan 2009 3:51 AM
Tom van Stiphout
On Tue, 13 Jan 2009 01:06:04 -0800, Laursen.Aarup
<LaursenAa***@discussions.microsoft.com> wrote:

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



Show quoteHide quote
>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
>
>"Tom van Stiphout" wrote:
>
>> On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
>> <Laursen.Aa***@discussions.microsoft.com> wrote:
>>
>> Simply create a shortcut like this:
>> <path_to>msaccess.exe <path_to>iofe.accdb /readonly
>>
>> -Tom.
>> Microsoft Access MVP
>>
>>
>> >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 
>>
Author
14 Jan 2009 5:51 AM
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

Show quoteHide quote
"Tom van Stiphout" wrote:

> On Tue, 13 Jan 2009 01:06:04 -0800, Laursen.Aarup
> <LaursenAa***@discussions.microsoft.com> wrote:
>
> 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
>
>
>
> >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
> >
> >"Tom van Stiphout" wrote:
> >
> >> On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
> >> <Laursen.Aa***@discussions.microsoft.com> wrote:
> >>
> >> Simply create a shortcut like this:
> >> <path_to>msaccess.exe <path_to>iofe.accdb /readonly
> >>
> >> -Tom.
> >> Microsoft Access MVP
> >>
> >>
> >> >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 
> >>
>
Author
14 Jan 2009 5:58 AM
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!

Show quoteHide quote
"Tom van Stiphout" wrote:

> On Tue, 13 Jan 2009 01:06:04 -0800, Laursen.Aarup
> <LaursenAa***@discussions.microsoft.com> wrote:
>
> 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
>
>
>
> >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
> >
> >"Tom van Stiphout" wrote:
> >
> >> On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
> >> <Laursen.Aa***@discussions.microsoft.com> wrote:
> >>
> >> Simply create a shortcut like this:
> >> <path_to>msaccess.exe <path_to>iofe.accdb /readonly
> >>
> >> -Tom.
> >> Microsoft Access MVP
> >>
> >>
> >> >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 
> >>
>
Author
14 Jan 2009 2:19 PM
Tom van Stiphout
On Tue, 13 Jan 2009 21:58:00 -0800, Laursen.Aarup
<LaursenAa***@discussions.microsoft.com> wrote:

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



Show quoteHide quote
>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!
>
>"Tom van Stiphout" wrote:
>
>> On Tue, 13 Jan 2009 01:06:04 -0800, Laursen.Aarup
>> <LaursenAa***@discussions.microsoft.com> wrote:
>>
>> 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
>>
>>
>>
>> >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
>> >
>> >"Tom van Stiphout" wrote:
>> >
>> >> On Sun, 11 Jan 2009 22:13:01 -0800, Laursen.Aarup
>> >> <Laursen.Aa***@discussions.microsoft.com> wrote:
>> >>
>> >> Simply create a shortcut like this:
>> >> <path_to>msaccess.exe <path_to>iofe.accdb /readonly
>> >>
>> >> -Tom.
>> >> Microsoft Access MVP
>> >>
>> >>
>> >> >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 
>> >>
>>
Author
13 Jan 2009 4:06 PM
Chris O'C via AccessMonster.com
I think you mean

<path_to>msaccess.exe <path_to>iofe.accdb /ro

http://office.microsoft.com/en-ca/access/HA101666051033.aspx

Chris


Tom van Stiphout wrote:
Show quoteHide quote
>Simply create a shortcut like this:
><path_to>msaccess.exe <path_to>iofe.accdb /readonly
>
>-Tom.
>Microsoft Access MVP


Bookmark and Share