Solved

code Log in history using VB?

Posted on 2002-03-30
7
185 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now