?
Solved

Keep Track of how many times some logs into my asset database?

Posted on 2003-11-05
7
Medium Priority
?
163 Views
Last Modified: 2013-12-24
Hi, I have an asset database that keeps track of all our Assets for our department.  I would like to add a something to keep track of how many times my users log into my database and will increment every time they log in.

Every time we take new hardware to a department, we keep track of those assets via web.  Everything works fine but would like to post how many times they have logged in and possibly show who logged in last.  I am just trying to make it a little more fun so our team remembers to use it more.

I am currently using an MS ACCESS database, anyone have any ideas?
0
Comment
Question by:fixx17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 9689361
In the users table just add a column called log on, each time someone logs into the system, add one to it.
0
 
LVL 1

Author Comment

by:fixx17
ID: 9689794
can you give me an example,

What if I added a coulumn called UserCount into the database.  What would be the SQL to increment that number?

Now keep in mind that I work for the University of Michingan on the Hospital side.  I connect to a database called Cert7 and that uses LDAP, but I don't have access to that database to add the column, because it has over 36,000 employees user names and passwords.  I don't have access.  

But the other developers gave me the path to authenticate to it, so I can at least pull up the First Name, Surname.  Once they are logged in, how what kind of CFC do I write to check in that users and increment it once.

I figure I can take his FirstName and Surname in a hidden field (If possible) and have some scirpt run to check if his name is in a database (that I have access to) and if it comes back TRUE, increment the column called UserCount.

Is this possible?  I will bump up the points if someone can give me an example of some script.

0
 
LVL 11

Accepted Solution

by:
hart earned 800 total points
ID: 9691973
ok in ur side add a table called userdetails..
in that keep a unique field

userid - number
firstname - text
surname - text
usercount - number


now u say that u can get the first name and surname from the other database,
could u get the unique identifier of each user from their database too.

s u will have three details from their side userid,firstname and surname
now as soon as u get this..


run this query


<cfquery name="qry_checkuser" datasource="ur datasource name">
   select userid from userdetails where userid = #the userid that u have got from their database#
</cfquery>


<cfif qry_checkuser.recordcount eq 0>
   <cfquery name="ins_user" datasource="ur datasource name">
         insert into userdetails (userid,firstname,surname,usercount)
                                 values (#userid#,'#firstname#','#surname#',1)
      </cfquery>
<cfelse>
     <cfquery name="upd_user" datasource="ur datasource name">
         update  userdetails set usercount = usercount + 1
         where userid = #userid#
     </cfquery>
</cfif>


Regards
Hart
0
 
LVL 1

Author Comment

by:fixx17
ID: 9697686
Sorry, did not have time today, I was doing something else.  I will try tomorrow and get back to you.

0
 

Assisted Solution

by:trr1jdg
trr1jdg earned 800 total points
ID: 9853328
If you don't have access to modify a table, the only thing you can do is add a new table as hart stated above.  

Another method of doing this would be to insert a record into this table every time that a user logs in (along with a time) and then when you want to count how many times they have logged in you can use a sql count() statement to get the number...with this option you would have the option of saying 23 users have logged in 10,000 times this month. Or the user that logs in can see that he has logged in 15 times this week.  

I have encountered this situation before and in my case I decided to insert a record every time.  I decided this because it was imperative that I didn't lose any data on when the user did what he or she did.  But it was a slightly different case than the "fun fix" that you are describing.  I can give you some code or diagrams if you are interested.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question