My Assistant
![]() ![]() |
|
|
Jul 7 2004, 03:58 AM
Post
#1
|
|
|
UtterAccess Member Posts: 33 From: Miland, Italy |
Hi to all.
With the help of many people in UA, I found the code to write text file. I want use it as a simple log to record date and time users logs in. Dim strFile As String Dim fhand As Integer strFile = "UsersLog.txt" fhand = FreeFile Open strFile For Output As #fhand LogDT = "[" & Now & "] -- " & UCase(strUserID) Print #fhand, LogDT Close #fhand This is part of the code that mishej suggested me (thanx!) and works fine, but every time the routine write the file, replace it with new data instead of adding a new line in the existing text file. Any ideas ? Thanx in advance |
|
|
|
Jul 7 2004, 04:56 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 5,244 From: Northern Virginia |
Don't know squat about this, but a quick perusal of the Help turned up the Append mode, so this line:
Open strFile For Output As #fhand you might want to change to Open strFile For Append As #fhand I don't know what happens if you try to use Append before the file is first created. It may or may not create it if it doesn't already exist. HTH Ben |
|
|
|
Jul 7 2004, 06:37 AM
Post
#3
|
|
|
Retired Moderator Posts: 13,544 From: Texas (Is there anywhere else?) |
FYI
QUOTE I don't know what happens if you try to use Append before the file is first created. It may or may not create it if it doesn't already exist. If the file specified by pathname doesn't exist, it is created when a file is opened for Append, Binary, Output, or Random modes |
|
|
|
Jul 7 2004, 08:47 AM
Post
#4
|
|
|
UtterAccess Member Posts: 33 From: Miland, Italy |
Ok everything works very good ! thanx to all
|
|
|
|
Aug 5 2004, 10:14 AM
Post
#5
|
|
|
UtterAccess Member Posts: 33 From: London, United Kingdom |
using '97 and coming up with "User-type type not defined" on the Print command, this looks like a reference problem, anyone know which reference would correct this?
Thanks Rack |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 24th May 2013 - 05:07 AM |