473,385 Members | 1,942 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,385 software developers and data experts.

Access Security

hay iam back . so itis shotokan too? weired i dk but here brown belt is 2 and 1 kius blue one is called 3kiu , green, orange 6 and 5 kiu, yellow 6 and 7 . that is the system here and shotokan too, but anyways itis just amartial art, and yap keep ur self strong :)

i have another question for u (told ya u won't get rid of me XD)
this time i don't have adata base or something complicated i just want to ask about the access programme abilities and limits. so i want to know is it possible to creat a user name and password for specific users.

for example , like when i logg in in yahoo account.i sign up then i logg in after my user name and password are saved in yahoo db

in access let's say i have a table with 7 names, and i closed my database so no one can access this data base but i want only those 7 people to access the data base, is this possible in access???

thank you
Nov 8 '09 #1

✓ answered by NeoPa

It is possible (or was at least - I hear they stopped it in Access 2007), but it is really not a very good system for many reasons, one of which is that you either have a scenario where anyone can quite easily get in as Administrator, or you have to manage the whole thing with the possibility of losing access to the file completely if you lose the System.Mdw file. Not to mention how much of a head-ache it is keeping it up-to-date when you make any amendments.

Personally, where this is a requirement, I tend to get the logged on user's name and check it against the allowed users list (that I store in a table) for each object.

The code I use for this is :
Expand|Select|Wrap|Line Numbers
  1. 'GetUser returns the user's logged on name.
  2. Public Function GetUser() As String
  3.     Dim strUserKey As String
  4.  
  5.     If Environ("OS") = "Windows_NT" Then
  6.         strUserKey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
  7.         GetUser = RegRead(conHKLM, strUserKey, "DefaultUserName")
  8.     Else
  9.         'Windows
  10.         strUserKey = "Network\Logon"
  11.         GetUser = RegRead(conHKLM, strUserKey, "username")
  12.     End If
  13. End Function
It uses an OS function from another module which is :
Expand|Select|Wrap|Line Numbers
  1. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
  2.     Alias "RegOpenKeyExA" (ByVal hKey As Long, _
  3.                            ByVal lpSubKey As String, _
  4.                            ByVal ulOptions As Long, _
  5.                            ByVal samDesired As Long, _
  6.                            phkResult As Long) As Long
  7. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) _
  8.                              As Long
  9. Private Declare Function RegQueryValueExStr Lib "advapi32.dll" _
  10.     Alias "RegQueryValueExA" (ByVal hKey As Long, _
  11.                               ByVal lpValueName As String, _
  12.                               ByVal lpReserved As Long, _
  13.                               lpType As Long, _
  14.                               ByVal lpData As String, _
  15.                               lpcbData As Long) As Long
  16.  
  17. Public Function RegRead(ByVal lngHive As Long, _
  18.                         ByVal strKey As String, _
  19.                         ByVal strValue As String) As Variant
  20.     Dim intIdx As Integer, intHK As Integer
  21.     Dim strWork As String
  22.     Dim lngRet As Long, cbLen As Long, lngHKey As Long, lngType As Long
  23.  
  24.     RegRead = Null
  25.     strKey = strKey & Chr(0)
  26.     lngRet = RegOpenKeyEx(lngHive, strKey, 0, conKeyRead, lngHKey)
  27.     If lngRet = conOK Then
  28.         'Create buffer to store value
  29.         strWork = Space(255)
  30.         cbLen = 255
  31.         lngRet = RegQueryValueExStr(lngHKey, _
  32.                                     strValue, _
  33.                                     0&, _
  34.                                     lngType, _
  35.                                     strWork, _
  36.                                     cbLen)
  37.         RegRead = Left(strWork, cbLen - 1)
  38.         If Len(RegRead) = 254 Then RegRead = Null
  39.         'Close key
  40.         Call RegCloseKey(lngHKey)
  41.     End If
  42. End Function

4 1613
NeoPa
32,556 Expert Mod 16PB
It is possible (or was at least - I hear they stopped it in Access 2007), but it is really not a very good system for many reasons, one of which is that you either have a scenario where anyone can quite easily get in as Administrator, or you have to manage the whole thing with the possibility of losing access to the file completely if you lose the System.Mdw file. Not to mention how much of a head-ache it is keeping it up-to-date when you make any amendments.

Personally, where this is a requirement, I tend to get the logged on user's name and check it against the allowed users list (that I store in a table) for each object.

The code I use for this is :
Expand|Select|Wrap|Line Numbers
  1. 'GetUser returns the user's logged on name.
  2. Public Function GetUser() As String
  3.     Dim strUserKey As String
  4.  
  5.     If Environ("OS") = "Windows_NT" Then
  6.         strUserKey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
  7.         GetUser = RegRead(conHKLM, strUserKey, "DefaultUserName")
  8.     Else
  9.         'Windows
  10.         strUserKey = "Network\Logon"
  11.         GetUser = RegRead(conHKLM, strUserKey, "username")
  12.     End If
  13. End Function
It uses an OS function from another module which is :
Expand|Select|Wrap|Line Numbers
  1. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
  2.     Alias "RegOpenKeyExA" (ByVal hKey As Long, _
  3.                            ByVal lpSubKey As String, _
  4.                            ByVal ulOptions As Long, _
  5.                            ByVal samDesired As Long, _
  6.                            phkResult As Long) As Long
  7. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) _
  8.                              As Long
  9. Private Declare Function RegQueryValueExStr Lib "advapi32.dll" _
  10.     Alias "RegQueryValueExA" (ByVal hKey As Long, _
  11.                               ByVal lpValueName As String, _
  12.                               ByVal lpReserved As Long, _
  13.                               lpType As Long, _
  14.                               ByVal lpData As String, _
  15.                               lpcbData As Long) As Long
  16.  
  17. Public Function RegRead(ByVal lngHive As Long, _
  18.                         ByVal strKey As String, _
  19.                         ByVal strValue As String) As Variant
  20.     Dim intIdx As Integer, intHK As Integer
  21.     Dim strWork As String
  22.     Dim lngRet As Long, cbLen As Long, lngHKey As Long, lngType As Long
  23.  
  24.     RegRead = Null
  25.     strKey = strKey & Chr(0)
  26.     lngRet = RegOpenKeyEx(lngHive, strKey, 0, conKeyRead, lngHKey)
  27.     If lngRet = conOK Then
  28.         'Create buffer to store value
  29.         strWork = Space(255)
  30.         cbLen = 255
  31.         lngRet = RegQueryValueExStr(lngHKey, _
  32.                                     strValue, _
  33.                                     0&, _
  34.                                     lngType, _
  35.                                     strWork, _
  36.                                     cbLen)
  37.         RegRead = Left(strWork, cbLen - 1)
  38.         If Len(RegRead) = 254 Then RegRead = Null
  39.         'Close key
  40.         Call RegCloseKey(lngHKey)
  41.     End If
  42. End Function
Nov 8 '09 #2
NeoPa
32,556 Expert Mod 16PB
It's Wado-Ryu, not Shotokan. My mistake.

Kyus from 1 to 9 are :
Brown (3 stripes); Brown (2 stripes); Brown (1 stripe); Blue; Green; Orange; Yellow; Red; White.

I moved your question btw as each question should be in its own thread, though you may post links between threads if it's relevant at all. I will do that here to ensure the conversation makes sense.

This was split from How to structure an access database.
Nov 8 '09 #3
yeah itis my mistake srry i should have made anew thread

thanks so much i gave ur answer to my boss and it was a valuable thanx if there is another question i will come to u defenitly :)
Nov 11 '09 #4
NeoPa
32,556 Expert Mod 16PB
@kurai hikari
Not a big problem. There are things you need to learn in time but you're still quite new.
Nov 12 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

32
by: Mike MacSween | last post by:
Further to 'Security - more complex than I thought' Has anybody ever seen any studies? Or anecdotal evidence? Done any studies themselves? Done any lab testing - you know - 10 users asked to get...
13
by: BigDaDDY | last post by:
Um yeah....In case you haven't figured it out, Microsoft sucks. I'm going to be kicked back in my chair eating popcorn and watching football 10 years from now, while all you clowns are scrambling...
7
by: Mark Thiel | last post by:
I am working on a project for my company, which has a structure of six major areas. Certain people need to have access to all of the data, whereas other people only require access to the...
11
by: Will | last post by:
I am looking at using a table with user names, passwords and user rights, which I would administer. I have read a lot about the shortfalls of this and the lack of security but the customer does...
3
by: mar10 | last post by:
I am creating a database in Access 2002 for a small firm that would like security on the tables. They want some employees to have write access only to tables, while others read-only. I have not...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
38
by: Oldie | last post by:
I have built an MS Access Application under MS Office XP (but I also own MS Office 2000). I have split the application in the pure database tables and all the queries, forms, reports and macro's. ...
23
by: Reggie | last post by:
Hi and TIA. I developed several A2K dbs which are now being run on my clients computer which have been upgraded to Access 03. I'm not sure exactly what they mean but of you know or could point me...
7
by: thebarefootnation | last post by:
Hi, I have created an access db that I would like to secure. The database will exist on a shared drive and be used at a number of different locations hence the reason to secure the database. ...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.