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

How can I update a table automatically with the network computer/user name

Hello: I'm wanting to update a Microsoft Access Table automatically with the network computer name and user name as soon as a user logs onto his/her computer. I would like this to happen with minimal disruption to the user. I have read about possibly using the Windows Scheduler or autoexec.bat to open an access database, run an autoexec macro, etc...I already know how to get the network computer name and user name. I'm looking for assistance with Windows scheduler, autoexec.bat or some other way of automatically updating the table. Thank you in advance for your assistance.
Sep 11 '10 #1
3 2588
NeoPa
32,556 Expert Mod 16PB
If it's when the user logs on then the scheduler would not be involved.

What, precisely, are you hoping for here? Your question isn't very clear and has few details. Is the table just a single record that gets overwritten? Maybe it manages various PCs. Please give us all the details so that we can help.
Sep 11 '10 #2
I'm wanting to be able to keep track of an employee's location in our department. Sometimes employees move to different teams, sometimes they move because of a temporary assignment. I'm wanting to be able keep track of their location for emergencies, reports, etc...I have Microsoft tables set up (i.e. tblEmployees, tblEquipment) where I keep track of employees and equipment. The tblemployee table has two fields (i.e. txtEmployeeId, txtComputerName) among others. txtComputerName is a primary key in the tblEquipment table and a foreign key in the tblEmployees table. When an employee logs on to a computer I would like retrieve the Computer Name and User Name from the network, run a query against the employee table looking for a match between the network User Name and the txtEmployeeID field. If a match is found then the txtComputerName field would be updated in the tblEmployees table with the network Computer Name of the computer they are currently logged onto. If they log on to a different computer then the program would update the txtComputerName field with the Computer Name of the new computer they logged on to. I know how to get the Computer Name and User Name from the network using VBA. However, I would like to be able to gather this information for each employee after they log onto their computer. I would the program designed so that the update process is invisible to the user or at least has minimal disruption to the employee. From reading postings on the internet, I believe I would have to add a line of code to the autoexec file in the startup folder that would open the Access database, run a macro to retrieve the network computer name and user id and update the tblEmployees table and then close the database. If you have any suggestions for using autoexec or any other method of updating the access table automatically upon logging into the network I would appreciate your assistance.
Sep 12 '10 #3
NeoPa
32,556 Expert Mod 16PB
That's very much clearer and I think I can help with that.

There are a number of issues here I suppose.
  1. Getting the User ID & PC Name.
  2. Open a database and automatically run VBA code (and probably close the database too) from the Command Line.
  3. How and when to invoke the process.
  1. These can quite reliably be retrieved from the Environment as UserDomain, UserName & ComputerName, yet there are other approaches that are even more reliable. I won't go into more detail here, but if you have VBA code to get this already then that's fine. The VBA function call to return a value from one of the Environment Variables is Environ().
    Expand|Select|Wrap|Line Numbers
    1. Environ("UserName")
  2. You'll find full details of this in Invoking a Database From the Command Line.
  3. Autoexec.Bat is one approach (actually there are many). A possibly easier and more appropriate one might be to invoke it from within a Logon Script. The advantage here is that you only need set it up the once and you would have pretty full control over who gets to run it (even all, if that's your choice).
Sep 13 '10 #4

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

Similar topics

2
by: John | last post by:
Hi, I have a data driven application which has some generalized components. So, for reuse, I am building the components so they can be reused in other projects ... it takes almost no extra...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
5
by: Mike Turco | last post by:
(This was also posted to comp.database.ms-access before I realized this was the hep group.) Lets say that my WinXP computer has two users: Michael and Kathryn. One or the other logs into the...
4
by: rdonnici | last post by:
Hi all, Is there any way to, given an IP address(or NETBIOS machinename - I can convert from one to other) from my network, and assuming that everyone needs to log on a NT/2K/Windows Server 2003...
2
by: Shaker | last post by:
On web server IIS, What is the User Name(Identity) of the webserver, that is trying to access a network directory on the local Intranet? for certain process while an ASP page is running. i.e,...
3
by: Funky | last post by:
Hi, I have developed an ASP.NET application which has been running in production for around 3 months without any major glitches. Recently, a user was attempting to upload a rather large CSV file...
4
by: Joe | last post by:
This may actually be an IIS configuration issue but any help would be appreciated. I'd like to display some content based upon who the current user is that is accessing an internal ASP.NET...
0
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As...
4
by: Dhessevick | last post by:
We are using a software package that requires a username and password. We want to write a routine that would read the users network user name variable on the system and look up the user name and...
1
by: phopman | last post by:
Hello lads! And ladderettes of course :-) I have a serious issue: I have a table. It consists of: ID Name Link ContentID ID is primary key, and ContentID is the foreign Key. What my...
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: 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: 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
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
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.