473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to import and export text from text-box to a txt file

hi everyone actually i have two text boxes one named Text1 and other Text2. i want that when i press command1 the text in the Text2 is saved to temp.txt and it will be displayed in Text1 from that txt file
Jun 7 '07 #1
4 5458
pureenhanoi
175 100+
-> save text to file
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Dim ft As Interger
  3. Dim fileName As String
  4.      fileName = "C:\textfile.txt"
  5.      ft = FreeFile
  6.      Open fileName For Output As #ft
  7.     'If you dont want clear existing text in textfile.txt then use following code instead
  8.     'Open fileName For Append As #ft
  9.     Print #ft,Text1.Text
  10. End Sub
  11.  
-> Read text From file
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command2_Click()
  2. Dim ft As integer
  3. Dim fileName As String
  4. Dim tempStr as String
  5.    fileName = "C:\filetext.txt"
  6.    ft = FreeFile
  7.    Open fileName For Input As #ft
  8.    While Not EOF(ft)
  9.         Line Input #ft,tempStr
  10.         Text2.Text = Text2.Text & tempStr
  11.    Wend
  12. End Sub
  13.  
Jun 7 '07 #2
thanks a lot but i actually want continuous entries in the txtfile
Jun 7 '07 #3
thanks a lot but i actually want continuous entries in the txtfile
pureenhanoi made a good code. i think its enough. also you can see
http://www.thescripts.com/forum/thread659246.html ;)
Jun 8 '07 #4
thanks a lot but i actually want continuous entries in the txtfile
pureenhanoi made a good code. i think its enough. also you can see
http://www.thescripts.com/forum/thread659246.html ;)
Jun 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Steve Jorgensen | last post by:
Hi all, I've just finished almost all of what has turned out to be a real bear of a project. It has to import data from a monthly spreadsheet export from another program, and convert that into...
2
by: GreyGeek | last post by:
I export data from a table that contains a varchar field that stores whole names in it. Some of the names include the apostrophe character.... O'Neal, etc... When I attempt to import the data...
7
by: phillip.s.powell | last post by:
We're looking at a GUI interface for our MySQL DB and I am interested in MySQL Administrator, however, one of our requirements is to be able to import/export databases. Is this possible or do I...
2
by: amirbehzadan | last post by:
Hello, I am writing some C++ classes and want to export them as .dll files so other users can import them and use the methods I have provided in those classes. I have two types of classes :...
3
by: amirbehzadan | last post by:
Hello, I am writing some C++ classes and want to export them as .dll files so other users can import them and use the methods I have provided in those classes. I have two types of classes :...
10
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in...
2
by: othellomy | last post by:
What are the ways to export/import data in/out of SQL Server 2005? I used to use DTS for 2000 to do such thing and now I can't even find the wizard in 2005!
12
by: joaotsetsemoita | last post by:
Hello everyone, im completly new to vb.net and I was assigned to do a simple piece of software that just had to select from um db in a MS access data base and insert into a SQL server Database....
2
by: gblaxx42 | last post by:
I created a DB to track soldier information. Each month reports are due to Brigade. Each Company and Battalion has there own version of the DB. What I need to do is export data from the Company then...
0
by: GBR | last post by:
As far as I know you need to use the 8i export to export the 9i database, but I'm not completly sure as I've never done a export/import from newer to older version, only the other way. hth ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.