Creating a read/write database.

Apr 15, 2013 at 12:21am
I have a question. I can't seem to find any specifics. I won't to create a code where a use can input a name. Now inside that name would be there information, such as numbers, id's, etc. I want it so that you can type in their name and search for it, then read all the information saved inside of it. And edit it if needed. I'm not sure at ALL how to do this.
Apr 15, 2013 at 12:25am
What kind of database?
Apr 15, 2013 at 12:32am
closed account (18hRX9L8)
You write a text file that looks like this:

Full Name, Tele-phon-e--Numb-er, I-D-Num-ber, ...
...
...

Then in the program you ask for the user's name, and you search through the text file until it finds the name, and it saves all the other info in a string array. (If it does not, ask the user if he/she wants to create an account.) From there, you can create a menu that says:

1. Print info.
2. Edit info.
3. Delete account.
4. Add new account.

In print info, you print out the string array.
In edit info, you get the new information, copy all the lines except the line with the old info, then add in the new information at the end.
In Delete account, you do the same thing as above but you leave behind the old info.
In add account, you copy the file along and add an extra line of information.


Hope this helps, post your code so we can help you. with it. Ask more realistic questions...
Last edited on Apr 15, 2013 at 12:33am
Topic archived. No new replies allowed.