473,549 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help me with limiting user view

I've developed a database that will be used by my team (25 people)
The database is based on the Resource Planner template

The database will reside on a shared drive.
What I'd to do now is create some sort of entry point into the
database that only shows the users records they own.

So I was thinking when the database opens the user selects their name.
Then the switchboard opens but no matter what they select from the
switchboard only records that have the same name as the name selected
at open will be displayed.

I don't need any sort of password protect

How should I do this?

Thanks
Steve J
Oct 24 '08 #1
2 1456
On Oct 24, 12:22*pm, Steve <dafella...@yah oo.comwrote:
I've developed a database that will be used by my team (25 people)
The database is based on the Resource Planner template

The database will reside on a shared drive.
What I'd to do now is create some sort of entry point into the
database that only shows the users records they own.

So I was thinking when the database opens the user selects their name.
Then the switchboard opens but no matter what they select from the
switchboard only records that have the same name as the name selected
at open will be displayed.

I don't need any sort of password protect

How should I do this?

Thanks
Steve J
create a table called tblUser
userId autonumber pk
userName
userLogin
create a module called mNtuser, to get their windows login containing,
this

Option Compare Database
Option Explicit

Declare Function GetUserName& Lib "advapi32.d ll" Alias
"GetUserNam eA" (ByVal lpBuffer As String, nSize As Long)

Public Function ntUserName() As String
Dim s$, cnt&, dl&, sz&

cnt& = 255
s$ = String$(255, vbNullChar)
dl& = GetUserName(s$, cnt&)
If (Asc(Mid$(s$, cnt&, 1)) = 0) Then
cnt& = cnt& - 1
End If

ntUserName = UCase(Left$(s$, cnt&))
End Function
public function userId as long
userId = nz(dlookup("use rId","tblUser", "userLogin = '" &
ntusername() & "'"),-1)
end function
use = userId() in all your queries as a condition on the userId field
to return all records belonging to that user
Oct 24 '08 #2
On Oct 24, 1:49*pm, Roger <lesperan...@na tpro.comwrote:
On Oct 24, 12:22*pm, Steve <dafella...@yah oo.comwrote:


I've developed a database that will be used by my team (25 people)
The database is based on the Resource Planner template
The database will reside on a shared drive.
What I'd to do now is create some sort of entry point into the
database that only shows the users records they own.
So I was thinking when the database opens the user selects their name.
Then the switchboard opens but no matter what they select from the
switchboard only records that have the same name as the name selected
at open will be displayed.
I don't need any sort of password protect
How should I do this?
Thanks
Steve J

create a table called tblUser
* * userId * autonumber pk
* * userName
* * userLogin

create a module called mNtuser, to get their windows login containing,
this

Option Compare Database
Option Explicit

Declare Function GetUserName& Lib "advapi32.d ll" Alias
"GetUserNam eA" (ByVal lpBuffer As String, nSize As Long)

Public Function ntUserName() As String
* * Dim s$, cnt&, dl&, sz&

* * cnt& = 255
* * s$ = String$(255, vbNullChar)
* * dl& = GetUserName(s$, cnt&)
* * If (Asc(Mid$(s$, cnt&, 1)) = 0) Then
* * * * cnt& = cnt& - 1
* * End If

* * ntUserName = UCase(Left$(s$, cnt&))
End Function

public function getUserId as long
* *userId = nz(dlookup("use rId","tblUser", "userLogin = '" *&
ntusername() & "'"),-1)
end function

use = userId() in all your queries as a condition on the userId field
to return all records belonging to that user- Hide quoted text -

- Show quoted text -
Steve
in response to your email, I'll post here so others can participate

The tbluser has the person's name and windows login (ntlogin)

If you don't know their windows login, you need to use ms-access
workgroup security, or have no security

Just having users select their name from a list is not a good idea,
cause I can choose your name, and see your records

since I don't have your table layout, I don't know how you identify
who records belong to who, I'm assuming it's an ID of some sort...
that ID and userId in tblUser is the same

the function ntUserName() gets your windows login
the function getUserId (I've renamed it from just 'userId') translates
the windows login to an ID that can be used to select records

so if your table is called tblResource with
resourceId autonumber pk
userId
resource

your query would be
SELECT * FROM tblResource WHERE userId = userId()

if I'm logged in, this will show my resources
and if you're logged in, yours
hope this helps
Oct 24 '08 #3

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

Similar topics

3
9353
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where clause after users typed in one or several letters/digits. My problem is as follows Most of the time I need to display form in continuous format,...
5
3210
by: randyelliott | last post by:
Good Day, I have a MS Access (Access 2000 now upgraded to 2003) database that tracks customer information. One function of this database is to create an encrypted license file for our software, which is then emailed out to the customer. The encryption string is based on information in the database and can only be generated by executing a...
17
2205
by: kimimaro | last post by:
How do you limits employee display where you enter the department for all the employee within that department be displayed and if lets say they are 100 or so and you have to limits 10 employee per page before entering anything to display the next 10 again?
118
6620
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely hated it, having learned C++ a few years prior. They didn't teach Lisp at all and instead expected us to learn on our own. I wasn't aware I had to...
1
1680
by: Griff | last post by:
Hi I'm not sure of the best way to go about achieving my goal and would appreciate any advice. What I would like to do is to generate a control that can be dropped onto a web page. For example, a control that provided catalogue information. As I envisage this, the control would be given a single argument (the end user identifier) and it...
1
1081
by: Technical | last post by:
Hi, I'm currently working on a webproject with ASP.NET 2.0, Visual Studio 2005, and SQL Server 2005 that allows users to search for and view images. My problems is that I need a way to limit users from directly accessing or linking to the images, but without needing to require users to logon. Currently, the site stores the images in a...
3
1838
by: Bob Alston | last post by:
What do others do to limit the number of characters a user can enter in a text box? Do you specify the number of characters exactly so that only that number will fit in the text box, thereby preventing the user from overfilling the text entry? Of course, if they do overfill, they can see/view the extra data by using the arrow key to...
4
4511
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst child apps of an IIS application and can be used by multiple users during the application life cycle and for multiple page loads for the same or...
4
1592
WyvsEyeView
by: WyvsEyeView | last post by:
I have a datasheet form in which one field is a combo box that will potentially contain hundreds of records. I've read about several methods of speeding up such combo boxes or limiting their initial contents and I have used those methods on "form view" forms, but they don't lend themselves to datasheet forms. One thing, of course, is to set the...
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7956
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1058
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.