473,385 Members | 1,753 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.

Identify Computer UserName in Access VBA

Hi, I am struggling with creating a unique name for a series of table that are temporary tables enabling my report to load quickly and accurately. What I want to do is attach the Windows UserName to the end of the table name and have the reports run from that table.

My database is using Access 2010 running on Windows 7 and is accessed by users from the network. In most cases I don't run into file sharing issues but in this case where I need temporary tables to run the reports from I run into issues where someone has the report open and another user goes to open the report and gets a message that the table is locked. I asked my IT department to allow me to push the front-end to desktops and got a no in response. So my solution is to make the tables unique to the user.

If I could pick up something that was unique to the user that would allow me to create and delete tables based on that user and other users would not be affected. When I look at the properties of the Locking File created when Access is open and go to details it lists the first person in the database as the Owner. That makes me think there has to be a way to pull the UserName, Owner, ComputerID or some other Identifier that can make my table name unique.

Have you run into this? Can you help? Thank you for taking the time to read my post.
Mar 13 '14 #1

✓ answered by zmbd

If you split your database, then each user will have their own copy of the front end; thus, the local copy will have their version of the temporay table without conflicting with others.

The following can be spoofed.
Environ("Username") gets the username of the person logged into Windows
Use the API call: Search here on Bytes for Access User name. VBA: Sample Code to Retrieve the Current User Name

Also be carefull of using Access's logged in user name in ACC2010 or ACCDB files, it will always return admin for the name.

3 4155
Seth Schrock
2,965 Expert 2GB
Environ("Username") gets the username of the person logged into Windows. However, instead of using this as part of a temp table name, I would recommend adding a field to your temp table for the username and then have your report filter the table based on that field.
Mar 13 '14 #2
zmbd
5,501 Expert Mod 4TB
If you split your database, then each user will have their own copy of the front end; thus, the local copy will have their version of the temporay table without conflicting with others.

The following can be spoofed.
Environ("Username") gets the username of the person logged into Windows
Use the API call: Search here on Bytes for Access User name. VBA: Sample Code to Retrieve the Current User Name

Also be carefull of using Access's logged in user name in ACC2010 or ACCDB files, it will always return admin for the name.
Mar 13 '14 #3
ZMBD that worked! Thank you.
Mar 13 '14 #4

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

Similar topics

1
by: Karen Hill | last post by:
I want multiple users on different computers to use an Access Database. What is the best way to do this? Currently each computer has a shortcut on the desktop to the database on the server which...
6
by: Rob | last post by:
Hi, I am working on a project that requires a Windows Service which performs the following file transfer functions. 1. It monitors a specific local directory on a Windows 2003 Server. 2. When...
0
by: Mr. x | last post by:
Hello, Security is my issue. I want to permit access from only one indevedual computer to some pages in the internet (site of my own). What should I have to ? Should I have SSL - How much does...
3
by: cliffeh | last post by:
I have an Intranet application that I'm deploying to our Shop Floor. What I would like is to have a front page that receives the request, identifies the computer that it's coming from, and then...
3
by: jason via DotNetMonster.com | last post by:
i am planning to add something that can capture the windows username in it and then i will save it to my database for further refference but how will the coding look like? i am new in asp.net...
1
by: Karl | last post by:
I have an Access 2000 mde. It runs OK on computers with Access 2007 except that it won't transfer data to an Excel worksheet using TransferSpreadSheet. Can I install the A2000 runtime on a...
12
by: MikeSA | last post by:
Hi The idea is to record and store the computer user's ID in a record, so that I can track which user created or altered the record. Eg. A certain user creates a quotation in a table called 'Orders'...
3
by: Earl Anderson | last post by:
One of the users in our departmental db has Read/Write permissions to a particular form. He was able to access and edit the form at will until 2 weeks ago. His current problem was that he was not...
3
by: Smurfas | last post by:
Hi, when I use: string name = Page.User.Identity.Name; or string name = Request.LogonUserIdentity.Name; I found computer name\username (who login) for example: Computer2\Jhon But, how find...
1
by: =?Utf-8?B?RFdhdHNvbkNyeXBLZXk=?= | last post by:
I need to be able to monitor a file and identify which processes have accessed them. Kind of like Windows Filemon does. The FileSystemWatcher doesn't seem to provide this information, and I can't...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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
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.