473,378 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Only Admin can change db.Props ?

Hi there,
I just distributed an application in which I (try to) change db.properties depending on
CurrentUser()
For instance I set the property's AllowBypassKey and AllowBuiltinToolbars to False when
CurrentUser() <> "xx"
I just noticed that the property's can only be changed changed by a user belonging to 'Admins'.
I never noticed this before.
I could swear that in other apps (A97) this works fine without the user being an admin...

Also I am struggeling with a weird kind of error or corruption.
When I start an application as mdb there is no problem at all.
BUT the app (developed in A2000), distributed as mde simply doesn't run in an Ofiice XP environment.
This is Access XP without any service pack.
Error message 'says' something like 'vba-project corruption...'
Maybe there is a relation between the two cases ?

Any of this sounds familiar?

TIA
Arno R



Nov 12 '05 #1
12 3023
MDEs are not cross-version compatible -- they must be run under the version
in which they were generated. MDBs can be run in later versions of the
product, or converted to MDE in that later version.

Larry Linson
Microsoft Access MVP

"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Hi there,
I just distributed an application in which I (try to) change db.properties depending on CurrentUser()
For instance I set the property's AllowBypassKey and AllowBuiltinToolbars to False when CurrentUser() <> "xx"
I just noticed that the property's can only be changed changed by a user belonging to 'Admins'. I never noticed this before.
I could swear that in other apps (A97) this works fine without the user being an admin...
Also I am struggeling with a weird kind of error or corruption.
When I start an application as mdb there is no problem at all.
BUT the app (developed in A2000), distributed as mde simply doesn't run in an Ofiice XP environment. This is Access XP without any service pack.
Error message 'says' something like 'vba-project corruption...'
Maybe there is a relation between the two cases ?

Any of this sounds familiar?

TIA
Arno R


Nov 12 '05 #2
TC

"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Hi there,
I just distributed an application in which I (try to) change db.properties depending on CurrentUser()
For instance I set the property's AllowBypassKey and AllowBuiltinToolbars to False when CurrentUser() <> "xx"
I just noticed that the property's can only be changed changed by a user belonging to 'Admins'. I never noticed this before.
I could swear that in other apps (A97) this works fine without the user being an admin...

Check out the DDL (4th?) parameter of your CreateProperty calls.

HTH,
TC

Also I am struggeling with a weird kind of error or corruption.
When I start an application as mdb there is no problem at all.
BUT the app (developed in A2000), distributed as mde simply doesn't run in an Ofiice XP environment. This is Access XP without any service pack.
Error message 'says' something like 'vba-project corruption...'
Maybe there is a relation between the two cases ?

Any of this sounds familiar?

TIA
Arno R


Nov 12 '05 #3
Thanks for the info TC
Check out the DDL (4th?) parameter of your CreateProperty calls.


The help states that the DDL property is False by default.
I didn't change any value I'm sure.

So I decompiled, Created a new mdb etc.
Then I changed the values to create the properties.
Still no go to change the props in code for the 'normal' user.

Again a new db
Now I created the properties in code with the parameter DDL set to FALSE
Still no go to change the props in code for the 'normal' user.
This is bizar !

I gave all users 'admin' rights to the db and it was allright then ...
They still aren't members of the admin-group and can't change anything I don't want them to.

Arno R
Nov 12 '05 #4
> MDEs are not cross-version compatible -- they must be run under the version
in which they were generated. MDBs can be run in later versions of the
product, or converted to MDE in that later version.


Hi Larry,
Are you sure about this ??
In my experience A2000 MDEs wil run without any problems in A2k2.
One other app works the same way I am sure.
(developed in A2000, and distributed as mde to A2k2 'environment')
AFAIK you just can't create A2000 MDEs from A2000 MDBs running in A2k2.

Arno R

Nov 12 '05 #5
TC
Thinking more about this.

If the db props are treated like other objects, then, the users who can
change those props would be:
* the owner of the database, and
* any user granted Administer permission on the database.
* CreateProperty DDL=False would suggests that you do not have to be a
member of the Admins group.

In the database is not secured, and DDL=False, the above list becomes:
* the Admin user, or
* any user granted Administer permission on the database.

So I guess this explains what you've found. If you are *not* Admin, you are
not the owner of the (unsecured) database, and you are not (in your example)
a member of the Admins group. So the only way you can update the props, is
to be givcen Administer permission to the database.

But wait! There is another method. A general user (with no Administer
permission to the database) could be allowed to execute code which called
CreateWorkspace with a "hidden" Admins group username/password. Then, you
could execute priviliged actions (such as changing the database props) via
that worksace - even though the current (human) user does not have
permission to change thos props directly!

Of course, you would have to MDE the database, so a user could not examine
your code, & see the username/password of the hidden Admins group member.

Check up on CreateWorkspace. I think that will be your solution. (Then you
could also change DDL back to true, if you wanted.)

HTH,
TC
"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Thanks for the info TC
Check out the DDL (4th?) parameter of your CreateProperty calls.
The help states that the DDL property is False by default.
I didn't change any value I'm sure.

So I decompiled, Created a new mdb etc.
Then I changed the values to create the properties.
Still no go to change the props in code for the 'normal' user.

Again a new db
Now I created the properties in code with the parameter DDL set to FALSE
Still no go to change the props in code for the 'normal' user.
This is bizar !

I gave all users 'admin' rights to the db and it was allright then ...
They still aren't members of the admin-group and can't change anything I

don't want them to.
Arno R

Nov 12 '05 #6
>If the database is not secured, and DDL=False, the above list becomes:
* the Admin user, or
* any user granted Administer permission on the database
So I guess this explains what you've found. If you are *not* Admin, you are
not the owner of the (unsecured) database, and you are not (in your example)
a member of the Admins group. So the only way you can update the props, is
to be givcen Administer permission to the database.
Do you think the database is not secured or am I misreading you?
But wait! There is another method. A general user (with no Administer
permission to the database) could be allowed to execute code which called
CreateWorkspace with a "hidden" Admins group username/password. Then, you
could execute priviliged actions (such as changing the database props) via
that worksace - even though the current (human) user does not have
permission to change thos props directly!


Very interesting, I might try this just to see if it works.
Condition for this is that I can run the app as mde
In my initial post I wrote that I also had a problem with this <sigh> ...
BUT the app (developed in A2000), distributed as mde simply doesn't run in an Ofiice XP

environment.

Next week I'll find out if this is solved. I think I found some corruption in a form.
Used SaveAsText and LoadFromText for a couple of forms.
Yet another problem that I can't explain.
When I deleted db.props through code in a loop I could not start the db again ... @#$%$
Sub TestProps()
Dim i As Integer
On Error Resume Next 'You can't delete build-in props
For i = 0 To CurrentDb.Properties.Count - 1
Debug.Print CurrentDb.Properties(i).Name
CurrentDb.Properties.Delete CurrentDb.Properties(i).Name
Next i
End Sub

Access 'complained' that the db was converted from a previous version by using DAO method
CompactDatabase etc.
(Message in Dutch, translation maybe not 100% )
This MUST be a bug. I created a NEW db in A2000. Just set some properties (menu StartUpOptions)
Then I ran the code. When you close the db, you can't get in again.
Compact and repair won't work.
I think I will start another thread on this.

Thanks a lot for sharing your ideas.

Arno R


Nov 12 '05 #7
TC

Arno R <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
If the database is not secured, and DDL=False, the above list becomes:
* the Admin user, or
* any user granted Administer permission on the database
So I guess this explains what you've found. If you are *not* Admin, you are
not the owner of the (unsecured) database, and you are not (in your example) a member of the Admins group. So the only way you can update the props, is to be givcen Administer permission to the database.
Do you think the database is not secured or am I misreading you?


Sorry, I thought you said that it was not secured. But I have lost the start
of this thread, so I'm probably just mistaken.
But wait! There is another method. A general user (with no Administer
permission to the database) could be allowed to execute code which called CreateWorkspace with a "hidden" Admins group username/password. Then, you could execute priviliged actions (such as changing the database props) via that worksace - even though the current (human) user does not have
permission to change thos props directly!


Very interesting, I might try this just to see if it works.
Condition for this is that I can run the app as mde
In my initial post I wrote that I also had a problem with this <sigh> ... BUT the app (developed in A2000), distributed as mde simply doesn't

run in an Ofiice XP environment.
Ok, that's a problem! Maybe you could use access security to deny design
permission to the form module(s) in question? Then the db is not an MDE, but
none-the-less, they will not be able to view the code containing the hidden
username/password. Note: I know that access user-level security no longer
works for standard modules in a2000(?)+, so you might need to check that itdoes< apply to form modules - I don't know.
Next week I'll find out if this is solved. I think I found some corruption in a form. Used SaveAsText and LoadFromText for a couple of forms.
Yet another problem that I can't explain.
When I deleted db.props through code in a loop I could not start the db again ... @#$%$ Sub TestProps()
Dim i As Integer
On Error Resume Next 'You can't delete build-in props
For i = 0 To CurrentDb.Properties.Count - 1
Debug.Print CurrentDb.Properties(i).Name
CurrentDb.Properties.Delete CurrentDb.Properties(i).Name
Next i
End Sub
There are some issues with deleting collection members in a loop of that
form. Also, CurrentDb refreshes all collections. That is an expensive
operation. You really want to call CurrentDb >once<, then cache the
reference.

So maybe try this:

dim db as database
set db = currentdb()
while db.properties.count > 0
on error resume next
db.properties.delete db.properties(1).name ' delete first member.
on error goto 0
wend

Check whether the first collection member index is 1 or 0. I can't remember.

HTH
TC


Access 'complained' that the db was converted from a previous version by using DAO method CompactDatabase etc.
(Message in Dutch, translation maybe not 100% )
This MUST be a bug. I created a NEW db in A2000. Just set some properties (menu StartUpOptions) Then I ran the code. When you close the db, you can't get in again.
Compact and repair won't work.
I think I will start another thread on this.

Thanks a lot for sharing your ideas.

Arno R


Nov 12 '05 #8
TC
Er, but as others have said elsewhere, you will probably not want to
continue deleting the database props!

HTH,
TC

Nov 12 '05 #9
Hi TC
Note: I know that access user-level security no longer
works for standard modules in a2000(?)+, so you might need to check that it
does< apply to form modules - I don't know.

Do you know where I can find more info on this ?
I don't want users to be able to see the code

There are some issues with deleting collection members in a loop of that
form. Also, CurrentDb refreshes all collections. That is an expensive
operation. You really want to call CurrentDb >once<, then cache the
reference.


You are right, thanks

Arno R
Nov 12 '05 #10
"Arno R" <ar****************@tiscali.nl> wrote...
Note: I know that access user-level security no longer
works for standard modules in a2000(?)+, so you might need to check that it
does< apply to form modules - I don't know.

Do you know where I can find more info on this ?


Clearly documented in help that security no longer applies to modules.
I don't want users to be able to see the code


MDE. Thats what it is there for. No other solution exists.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

Nov 12 '05 #11
Sorry, I misread what you wrote. I thought you were generating the MDE in
Access 2002 and trying to run it in Access 2000. I know that does not work;
I haven't tried the other and haven't seen it discussed.

Larry Linson
Microsoft Access MVP

"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
MDEs are not cross-version compatible -- they must be run under the version in which they were generated. MDBs can be run in later versions of the
product, or converted to MDE in that later version.


Hi Larry,
Are you sure about this ??
In my experience A2000 MDEs wil run without any problems in A2k2.
One other app works the same way I am sure.
(developed in A2000, and distributed as mde to A2k2 'environment')
AFAIK you just can't create A2000 MDEs from A2000 MDBs running in A2k2.

Arno R


Nov 12 '05 #12
TC

"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Hi TC
Note: I know that access user-level security no longer
works for standard modules in a2000(?)+, so you might need to check that it
does< apply to form modules - I don't know.

Do you know where I can find more info on this ?
I don't want users to be able to see the code


The only other way would be the so-called project/VBA?/VBE? password. Check
in online help.

HTH,
TC

There are some issues with deleting collection members in a loop of that
form. Also, CurrentDb refreshes all collections. That is an expensive
operation. You really want to call CurrentDb >once<, then cache the
reference.


You are right, thanks

Arno R

Nov 12 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to...
1
by: thilo | last post by:
hi ng! i need to change the (inline) style-setting - ie the "style=" attribute - for an html-<input> by client-side script, according to the "value" of another <input>. i declared it like that...
13
by: Arno R | last post by:
Hi all In another thread I had problems changing db.props Another problem I encountered while testing this: db corrupt When I deleted db.props through code in a loop I could not start the db again...
3
by: boxim | last post by:
got some static props in some classes some of the props need to refer to other static members of the other classes however, cos they're not simple types, cant use const, have to use readonly how...
4
by: Steve Drake | last post by:
All, If you right click on a word doc, you can see and set the custom props for the document, how can this be done in C# (or any other lang) I don't want to automate word as this will be...
3
by: ibiza | last post by:
Hi all, I am currently developing in asp.net 2.0 and I was at first impressed with the numerous login and user controls they provided to ease the task of managing users. But I am starting to...
0
by: Groove | last post by:
I've noticed something that's come up twice today alone. In ASP.NET 1, I could reference and use a control's property if the control was set to readonly or if it was set to visible = false. Such...
4
by: maya | last post by:
pls what is order of font-props when not specifying names of properties in specification can I assume this is the order: http://www.w3.org/TR/REC-CSS2/fonts.html#font-properties i.e., can I...
0
by: ruediger.papke | last post by:
Hi, I have an installation DB2 V9.1 on suse linux. because of an java error when trying to create the systools catalog i'm going to change the JDK-PATH with no success db2 get admin cfg .......
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.