Solved

Saving Data to disk

Posted on 2000-03-06
5
141 Views
Last Modified: 2010-05-02
I need to save data, namely text, to disk. How do I do this. What command do I use?
0
Comment
Question by:R_N_WARD
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
pit_ earned 50 total points
ID: 2588684
The easiest way to save text to a file is to first, open a file on the disk, then write the text out, and then close the file.


Dim ff As Integer
Dim strFileName as String

ff = FreeFile
strFileName = "data.txt"

Open strFileName For Output As ff
Print #ff, strData
Print #ff, strData2
  ...
Close ff
0
 
LVL 2

Expert Comment

by:danelroisman
ID: 2588709
'Save text into the file:
Dim number As Integer
number = FreeFile

Open "Text.txt" & MyIndex For Output As number
   Write #number, "This is a sample."
Close #number

0
 

Author Comment

by:R_N_WARD
ID: 2588712
Thank you.  A++.  Now could you tell me how to loud the data back to the textbox?
0
 
LVL 1

Expert Comment

by:pit_
ID: 2588730
Pretty much the same way, except instead of opening the file for Output, open it for Input and use Input #ff, ...


ex.

Open strFileName For Input As ff
Input #ff, strData
Close

txtBox.Text = strData
0
 

Author Comment

by:R_N_WARD
ID: 2588746
Thanks for all the help
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question