Solved

code Log in history using VB?

Posted on 2002-03-30
7
195 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
[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 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

636 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