If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > creating file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-30-04, 05:31
vijayk vijayk is offline
Registered User
 
Join Date: Mar 2004
Location: Mumbai, India
Posts: 15
Question 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.
Reply With Quote
  #2 (permalink)  
Old 03-30-04, 12:02
SCIROCCO SCIROCCO is offline
Registered User
 
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!
Reply With Quote
  #3 (permalink)  
Old 03-30-04, 14:50
vijayk vijayk is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 04-01-04, 01:46
SCIROCCO SCIROCCO is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On