writing into a log file

Hi,

I'm using a software with the support of VB that has a function to track data change.
How can I write these changes on a logfile with the Pc time and date?
Private Sub ObjOPCGroup_DataChange(ByVal TransactionID As Long, ByVal NumItems As Long, ClientHandles() As Long, ItemValues() As Variant, Qualities() As Long, TimeStamps() As Date)
    Dim i As Integer
    Dim strChanges As String
    For i = 1 To NumItems
        strChanges = strChanges & Array_Items(ClientHandles(i)) & " New Values " & ItemValues(i) & vbCrLf
    Next i
    
    'Write strChanges into log file???
    
End Sub

Open in new window

csharp_learnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

twolCommented:
I could jot a littl code for you, but look at this link...it is pretty thorough.
http://www.builderau.com.au/program/windows/soa/Reading-and-writing-text-files-with-VB-NET/0,339024644,320267367,00.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
csharp_learnerAuthor Commented:
thanks for your reply,

I tried with the following code, but the line
oWrite.WriteLine("{0,10:dd MMMM}{....
kept returning an error of missing "="

is there a syntax error?
Private Sub ObjOPCGroup_DataChange(ByVal TransactionID As Long, ByVal NumItems As Long, ClientHandles() As Long, ItemValues() As Variant, Qualities() As Long, TimeStamps() As Date)
    Dim i As Integer
    Dim strChanges As String
    
    Dim oFile As System.IO.File
    Dim oRead As System.IO.StreamReader
    
    For i = 1 To NumItems
        strChanges = strChanges & Array_Items(ClientHandles(i)) & " New Values " & ItemValues(i) & vbCrLf
    Next i

    oRead = oFile.OpenText("C:\transActive\bin\SIG_Schematic_log.txt")
    oWrite.WriteLine("{0,10:dd MMMM}{0,10:hh:mm tt}{1,25:C}", Now(),strChanges)
    oWrite.Close()
    
End Sub

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.