Solved

code Log in history using VB?

Posted on 2002-03-30
7
184 Views
Last Modified: 2010-05-02
hello, i have no idea how do u create a log book using visual basic. Do you use looping and calculations? See, the question i have in mind is how to create a log book in visual basic where whenever a user enters into lets say your program in VB, this prg will record the time the user logs in, and this user is loggin in by using what ID. (meaning it's kept in a database) and later if the database administrator wants t print out the report, the prograM Should be able to print it out?

how do i code that? i'm totally at lost right now.
0
Comment
Question by:pohleen
7 Comments
 
LVL 4

Accepted Solution

by:
Steve Sirica earned 200 total points
ID: 6906860
At 1st glace this sound as simple as just writing to a file?  I may be over simplifying, and excuse me if I am, but just use one of the methods to wite info out to a file.  I would use the FileSystemObject.  I'm sure I'm going to catch slack for that suggestion.
0
 
LVL 1

Expert Comment

by:alaplume
ID: 6907856
Even if users don't have to log in to your app you can't find out who is logged into the machine using an API. Then you simply write a record to you log table using the username, datetime etc...
0
 
LVL 4

Expert Comment

by:escheider
ID: 6907888
Here is a good reference on creating logfiles using VB:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q161306

It explains how to create the logging mechanism and utilize it.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:pohleen
ID: 6908984
anybody can code this will deserve 200 points.i know it isn't much but it's all i could afford... i'm kinda in a deep mess now coz time is the biggest prob....thanks...
0
 
LVL 4

Expert Comment

by:Steve Sirica
ID: 6910058
Once again I may be over simplifying, but a log file is nothing more than a text with a .log extension.  Here is some simple code to write out a text/log file.

Dim FSO         As Object
Dim fsoTS       As Object

Set FSO = CreateObject("Scripting.FileSystemObject")
Set fsoTS = FSO.OpenTextFile("c:\test.log", 8, True)

fsoTS.WriteLine "write out log info here."

fsoTS.Close

This is what I use and it works fine for me.

Good luck.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7637984
Hi pohleen,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept SSirica's comment(s) as an answer.

pohleen, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7754887
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now