Solved

code Log in history using VB?

Posted on 2002-03-30
7
190 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

738 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