473,382 Members | 1,377 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,382 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 4154
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: 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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.