473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

making a logfile

FJ
Hi all,

I hope someone can help me with the following:

I want my database to make a logfile in which it puts the date and time
a code is used. The code is triggered by a timer. Every x mins it
checks something and I want to write the time and date it checks into
that logfile.

So far I have only been able to make it a new file each time, but I
want it to be added in a text file (so that in the end you open the
file and see all the times and dates).

Does anyone have a bright idea on how to do this?

Thanks in advance!
F-J

Nov 13 '05 #1
1 3172
I use this to log errors
Public Sub errorLog(strWhere As String)
Dim strMsg As String
Dim strErr As String
Dim intFp As Integer

strErr = ""
If (Err.Number <> 0) Then
strErr = " - " & Err.Description
End If

On Error Resume Next
intFp = FreeFile
Open logFile & ntUserName() & "-RW.txt" For Append As #intFp
strMsg = Day(Now) & " " & Month(Now) & " " & Year(Now)
strMsg = strMsg & " - " & Hour(Now) & ":" & Format(Minute(Now),
"00")
strMsg = strMsg & " " & strWhere & strErr
Print #intFp, strMsg
Close #intFp
Err.Clear
End Sub

Public Sub resetLog()
On Error Resume Next
Kill logFile & ntUserName() & "-RW.txt"
Err.Clear
errorLog "Log reset"
End Sub
Public Sub msg(strMsg As String)
Dim intFp As Integer

On Error Resume Next
intFp = FreeFile
Open logFile & ntUserName() & "-RW.txt" For Append As #intFp
Print #intFp, strMsg
Close #intFp
Err.Clear
End Sub


FJ wrote:
Hi all,

I hope someone can help me with the following:

I want my database to make a logfile in which it puts the date and time
a code is used. The code is triggered by a timer. Every x mins it
checks something and I want to write the time and date it checks into
that logfile.

So far I have only been able to make it a new file each time, but I
want it to be added in a text file (so that in the end you open the
file and see all the times and dates).

Does anyone have a bright idea on how to do this?

Thanks in advance!
F-J


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Leader | last post by:
Hi, I want to take backup of database logfile periodically and automatically. What should i do then..... Thanks Hoque
0
by: guf | last post by:
Hi All, I have SQL Server 2000 sp3, Windows 2000 Server. I have a database which is used by an application server. I do several important jobs a day in the application server and never access my...
3
by: ZoombyWoof | last post by:
HI all. I would like the same behaviour on the Microsoft Firewall logfile that you have on logfiles under unixes, you can make them rotate so that once a week or once a day the system renames the...
2
by: ge_orgy | last post by:
Accidently, I(we) deleted the Logfile.LDF in sysfiles folder on the mssql server and now can't enter the database, which status now is set SUSPECT. Before deleting the logfile I did a...
2
by: Andi Clemens | last post by:
Hi, we had some problems in the last weeks with our mailserver. Some messages were not delivered and we wanted to know why. But looking through the logfile is a time consuming process. So I...
6
by: roger.lagrilliere | last post by:
Hello, is anyone willing to help me out to setup a logfile. I have a program running in Access, but I want to know the progress of it. It is rather easy I think, but don't know how to handle...
0
by: indiarocks | last post by:
Is there a way in which the all the logging done using pexpect can be sent to stdout as well as a file. eg. filea = file('output.log',"w") ssh = pexpect.spawn('ssh root@1.1.1.1') ssh.logfile...
0
by: Adam | last post by:
Hello, I have a small app I am creating to crawl a directory and check that if it is moved to another a location it's path will not break a character limit. Usually the Windows path limit. ...
8
by: sheldoncs | last post by:
System.InvalidOperationException was unhandled Message="Client found response content type of 'text/plain; charset=utf-8', but expected 'text/xml'. The request failed with the error message: --...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.