How to Create a LOGFILE


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to Create a LOGFILE

  1. #1
    Join Date
    May 2006
    Posts
    1

    Question How to Create/Attach a LOGFILE in Microsoft Access

    Hi!
    Can any one help me out... i want to create a Log File for my Access database,, i dont know where to start.,,

    Kind Regards
    Andrew

    NB: i'll appriciate your support..
    Last edited by bazo; 05-24-2006 at 03:42 AM. Reason: To be more clear on what i've asked

  2. #2
    Join Date
    May 2006
    Posts
    9
    You need to use VB to create a function that will write out your log file. There is a built-in VB object (FileSystemObject) that can be used to open, read and write to files.

    Here is a simple example from the Help files built into Access 2002:

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile("c:\testfile.txt", True)
    a.WriteLine("This is a test.")
    a.Close

    Here is an example of reading in a preexisting file:

    Sub OpenTextFileTest
    Const ForReading = 1, ForWriting = 2, ForAppending = 3
    Dim fs, f
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse)
    f.Write "Hello world!"
    f.Close
    End Sub

Similar Threads

  1. Getting a GUI to run
    By Eric in forum Java
    Replies: 4
    Last Post: 04-14-2006, 09:09 AM
  2. Re: (No subject)
    By Joe in forum Database
    Replies: 0
    Last Post: 04-04-2003, 05:13 PM
  3. Can't create a PARADOX file and insert records using ODBC
    By Steve Oliver in forum VB Classic
    Replies: 0
    Last Post: 07-26-2002, 12:30 PM
  4. Replies: 0
    Last Post: 07-25-2002, 04:29 PM
  5. Getting a GUI to function
    By Eric in forum Java
    Replies: 1
    Last Post: 11-27-2001, 06:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center