Results 1 to 4 of 4

Thread: creating file

  1. #1
    Join Date
    Mar 2004
    Location
    Mumbai, India
    Posts
    15

    Question Unanswered: creating file

    hi,
    I am trying to create a file using vb...
    I want to create a file at runtime in vb. I believe the code is very simple.But having trouble getting it right. kindly help.
    Thankyou. --- Vijay.

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: creating file

    You will have to be more specific on what type of file are you creating? Text file, excel file, xml file etc...
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Mar 2004
    Location
    Mumbai, India
    Posts
    15

    Wink Re: creating file

    sorry, I should have mentioned that. It would be a txt file.
    the txt file should be created where the .exe file of the proj that I have made resides. Thanxs. - vijay

  4. #4
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: creating file

    No problem. Reference the Microsoft Scripting Object. Here is some sample code:

    Dim fso As Scripting.FileSystemObject
    Dim MyFile

    Set fso = new Scripting.FileSystemObject
    Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
    MyFile.WriteLine("This is a test.")
    MyFile.Close
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •