Hi,
I am in the process of developing an IT Asset Tracking System in VB.NET.
I have come across a small problem though. A user is assigned to a Desktop PC and also assigned to other items such as a Printer, Monitor etc. The workstation details along with the user is stored in one table and other items associated with the user are stored in another table.
If I then disassociate the user from the Desktop PC by removing the userID, I also want the userid disassociation to happen on the other table where there were other items assigned to the user. If I then assign a new user to the Desktop PC, how can I then assign this new user to the other items
Regards
Dipendra

How to update ID values in multiple tables
Nung
Anurag G
Table PC_Equipment(PCID, EquipID)
Here are a few example rows:
PCID EquipID
---- -------
pc44 mon28
pc44 pri12
pc44 key07
pc44 mse99
Now say you wanted to move monitor 28 to pc 13. Delete the first row I listed above and add this row:
pc13 mon28
Make sense
Bob
JamesAins
Thanks for the advice. I understand that when a user is disassociated from a PC then a row would be deleted from the User_PC table therefore the items that belong to the PC remain intact.
My other problem would be when an individual item assigned to the PC such as a monitor, printer etc has to move to another PC as these activities can occur as well. How would I get around this problem.
Regards
Dipendra
BrianBrian
In my company a PC would always be associated with the same set of other items and when a user is disassociated, another user has to acquire those items rather than being used in any combination.
There must be way of getting around this issue.
Michael J
I do understand this example, but I would need to retain the EQUIPID value somehow in order for another PC to be assigned this item. If a DELETE statement is run then this will remove the row permanently or do I need to use an UPDATE statement.
Regards
Dipendra
jack the ripper
Rick2K
So would the following schema (I use that term loosely) work for you:
Table: User (UserID, Name, etc)
Table: PC (PCID, Location, etc)
Table: Equipment(EquipID, Description, etc)
Table: PC_Equipment(PCID, EquipID)
Table User_PC(UserID, PCID)
So the user table has a record of all users keyed on user ID. The PC table keeps track of all PC's with key PCID. Likewise the Equipment table keeps track of various pieces of misc equipment (mice, keyboards, etc). The PC_Equipment table records the one to many relationship between one PC and one or more pieces of equipment. The User_PC table records the one to one relationship between a given user and a given PC. If you disassociate a user from a PC, you are deleting a row from User_PC, but the relationship between that PC and its equipment Equipment is unchanged, and it is ready for the next user who comes along.
HTH,
Bob