473,327 Members | 2,094 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,327 software developers and data experts.

How to save text data in my programme

hi,
is any one can help me? i have create a form and it have 3 text boxes..and i want to type some data in that text boxes and when i click save button i want to save that data in my form...i don't know how to do it...please any one can teach me to do that ...
thank you
Apr 10 '07 #1
6 4462
Killer42
8,435 Expert 8TB
hi,
is any one can help me? i have create a form and it have 3 text boxes..and i want to type some data in that text boxes and when i click save button i want to save that data in my form...i don't know how to do it...please any one can teach me to do that ...
Open a text file, write the information into it, close the file.

There are two techniques you would be likely to use. (I'm going to assume you're using VB6 - you didn't say).
  • Simpler to code, but providing less functionality, is the use of the Open...Close and various related statements.
  • The FileSystemObject requires you to add Microsoft Scripting Runtime to your project (under Project | References), and takes a little more work. But it provides a lot more power to work with files, folders and drives.
For more information, you should look up the various statements (such as Open, Close, Get, Input # and so on) and the FileSystemObject in your documentation.
Apr 10 '07 #2
sorry i can't understand...i'm using vb6 and can u please send cord's? and metod to how to do it...
thank u
Apr 10 '07 #3
Killer42
8,435 Expert 8TB
sorry i can't understand...i'm using vb6 and can u please send cord's? and metod to how to do it...
thank u
It would really be better if you read the documentation and explore this stuff. The main purpose of TheScripts is to provide help when programmers are stuck on a particular problem in their code. We're not a school.

Also, quite a lot of students come here and try to get copy-and-paste answers to homework and coursework assignments. Providing them doesn't help the student, and on occasion has actually gotten them into serious trouble with their teachers.

So, for many reasons, we try not to provide hand-holding at the beginner level. Sorry, but as you can see there are good reasons for this policy. And there are web sites out there which will provide basic tutorials, if you search for them. For that matter, if you use the search facility here on TheScripts, chances are good you will find what you're after anyway. I'm sure basic file access must have been discussed at various times.
Apr 10 '07 #4
hi,
is any one can help me? i have create a form and it have 3 text boxes..and i want to type some data in that text boxes and when i click save button i want to save that data in my form...i don't know how to do it...please any one can teach me to do that ...
thank you
hello,
befofe using the code add reference from Project--->reference
"Microsoft Scripting Runtime"
Expand|Select|Wrap|Line Numbers
  1. Dim fsys As New FileSystemObject
  2. Dim Txtfl As TextStream
  3.  
  4.  Set Txtfl = fsys.CreateTextFile(app.path & "\"  & "CAADVREG.txt", True)
  5. Txtfl.WriteLine text1.text
  6. Txtfl.WriteLine text2.text
  7. Txtfl.WriteLine tex3.text
  8. txtfl.close
  9.  
Apr 10 '07 #5
evank3
2
I read this on another site, and I think it works

Declarations:
Expand|Select|Wrap|Line Numbers
  1. Private myString As String
To Retrieve Data:
Expand|Select|Wrap|Line Numbers
  1. myString = GetSetting("myApp", "Settings", "myString", vbNullString)
  2. Textbox1.Text = myString
  3. myString = GetSetting("myApp", "Settings", "myString2", vbNullString)
  4. Textbox2.Text = mystring
  5. myString = GetSetting("myApp", "Settings", "myString*and so on*", vbNullString)
  6. Textbox3.Text = mystring
To Set Data:
Expand|Select|Wrap|Line Numbers
  1. myString = Textbox1.Text
  2. SaveSetting "myApp", "Settings", "myString", myString
  3. myString = Textbox2.Text
  4. SaveSetting "myApp", "Settings", "myString2", myString
  5. myString = Textbox3.Text
  6. SaveSetting "myApp", "Settings", "myString*and so on*", myString
Apr 10 '07 #6
Killer42
8,435 Expert 8TB
I read this on another site, and I think it works
...
I think you will find that the SaveSetting and GetSetting funtions are for reading and writing values in the Registry. As such, they probably should be used with some care, and preferably after reading the documentation.
Apr 11 '07 #7

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

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
0
by: Marcel - IDUG Europe 2005 | last post by:
Hi DB2 users, ========================================================================================= We just created a blog dedicated to our upcoming IDUG 2005 Europe Conference (24-28...
5
by: Øyvind Isaksen | last post by:
I have a page with an optional integer-field, and one asp:calendar control. I use a stored procedure to save the data in SQL Server. When all fields contains data, the code works great! But if the...
2
by: garyusenet | last post by:
Hi All, I have been working on the following programme over the last day or so and have made a good deal of progress. It is a very simple programme, but is proving very useful as a learning aid,...
0
by: amrhi | last post by:
Hy Guys , Can anybody help me ? I try to make small web database in my unit. Some of fields have on change behaviour to get other data that automatically filled other text field. But when i try to...
1
by: Rameel | last post by:
Friends, I'm probably being more critical with VB.Net Windows application. I have Developed VisualStudio 20005 VB.Net Windows application how willl i be able to save a specific record into my...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
3
by: sena0112 | last post by:
Hi, I'm a beginner in visual basic and programming. My programme needs to let the user browse for a text file and when the user press a command button, the programme will list out the text file into...
7
vikas251074
by: vikas251074 | last post by:
Can I get automatic focus on first text item just after running programme? Because when I run the programme, there is no focus on any text item at the first instant. I have to use mouse to go to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.