0

how can i use notepad as my database and how can i search a list of data, compute numbers inside the notepad and how can i align some list of data in the textbox???

2
Contributors
1
Reply
9
Views
7 Years
Discussion Span
Last Post by AndreRet
1

you will be using something like -

'Either put this in a a open buttons click event or do it when the form loads:
Open "C:\path_to_your_file\file_name.txt" For Input as #1

'put this in your next buttons event:
Dim temp as String
Dim data() As String

Do While Eof(1) = 0
   line input #1,temp
   data = Split(line, ",")
   TextBox1.Text = data[0]
   TextBox2.Text = data[1]
Loop

'Either put this in a close buttons event or put it in your form close event.
Close #1

'You will need to add error handling. If one line of the file doesn't contain two 'elements this code will throw an exception. Wrap the assignments of the text boxes 'in an if statement that check to make sure the data array has the correct number of elements.

The link below covers adding and retrieving data from a text file, as well as how to arrange the text in columns. This should answer your question.

http://www.vb6.us/tutorials/how-read-simple-text-files

Did this help?

Votes + Comments
Thank's
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.