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

Saving Data into a text file

How would i save a list of names, lets say, and then when I go to the file bar and click Class 1. How would i get the names from the txt File into a text box or label?
Oct 30 '06 #1
1 4753
Killer42
8,435 Expert 8TB
How would i save a list of names, lets say, and then when I go to the file bar and click Class 1. How would i get the names from the txt File into a text box or label?
Probably the simplest way is to use something like
Expand|Select|Wrap|Line Numbers
  1. Open "MyFile.txt" For Output Access Write Lock Read Write As #1
  2. Print #1, Count
  3. For I = 1 To Count
  4.   Print #1, Name(I)
  5. Next
  6. Close #1
Then to read them back in, you would do something like
Expand|Select|Wrap|Line Numbers
  1. Open "MyFile.txt" For Input Access Read Shared As #1
  2. Line Input #1,Count
  3. Redim Names(Count)
  4. For I = 1 To Count
  5.   Line Ipnut #1, Name(I)
  6. Next
  7. Close #1
This should help get you started, but of course I have made a lot of assumptions here.
Oct 30 '06 #2

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

Similar topics

7
by: G-Factor | last post by:
Hi all I've just started learning about saving files. I got bit of a problem. The following code gives me an error about incompatible types. (Cannot covert from class character to char *). I...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
5
by: Jason | last post by:
Hello all, I am new to this newsgroup but look forward to participating quite a bit. I have a simple question which hopefully someone will be able to answer. I am wanting to write an app with vb...
0
by: Karen Grube | last post by:
Hi! I hate to bother you all with this, but I don't know how best to approach a particular task. Here's the deal: Once a month I personally (that is, in my own personal inbox on my...
5
by: Lee | last post by:
Hi, I have a rich text box that can have hyperlinks ect within the text! when I save this data to file how should I do it? that is can I just save it as text? or do I need to serialize it...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
8
by: Yu SONG | last post by:
Hi all, What would be the most efficient way to save an array of floats to a file (in text format)? At the moment, my code looks like: /* * Saving an array of floats to a file
0
by: Shyam Barnwal | last post by:
Hi All, I am working on winamp general purpose pluggin "gen_whatsplaying " project downloaded from the site www.schaffrath.net I compiled and build the project successfully using platform SDK...
3
by: pozze | last post by:
Hi, I've just made the change from ASP to .net. I have a file (code below) that saves a user submitted file to a MS SQL 2005 database. It collects the file name, file size, file type, and lastly...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.