Organizing and searching individual records... how?

zsouthboy

Regular
I am attempting to create my own program to keep about 100 records, in a centralized location (the program)... yes I could do this in excel, that's not the point :p

I have no idea on how I will store and retrieve these "records" to disk, and be able to search and organize them.

I was considering just writing every value for each record in individual lines in a text file, and then figuring out how to keep track and change the information as needed... but that seems very complex... I have been told that I should just do some database connection stuff using Access in the program, but I have no idea how to do that.

Help?
 
Depends...

If you want to get this up and running quickly, then going the database route will clearly be your best bet. Setting up an application to use/connect to a database is a pretty trivial process, and there are a million resources on the net to assist you in doing this.

On the other hand, if you want to write your own for academic purposes, there are some pretty easy ways you can achieve this as well, provided you have a decent background in software devel. The easiest path would probably be to go the XML route. Under a language like C# (or any .NET language), you would simply define the schema for your individual records, then let the IDE create a strongly-typed Dataset for you...Once you have that Dataset object, you can then use that to Read/Write/etc. your data.
 
I agreed. Provided you have a database set up, it's pretty much just connecting the ui to the different database elements these days. XML would probably be the most compatible/future proof approach though. Alternatively you could just use a csv file. You can import it in excel afterwards if you like. You could also use streaming. Lotsa ways...
 
I ended up using appwizard to create an SDI database program, for access files, so it did all the headache stuff for me. I then combined what I had already worked on with the new program... worked out pretty well. Thanks for the help though. :)
 
I have been thinking about kind of the same thing.

Would it be a bad idea to simple make an object with the data elements (or a struct) and simply writing that to a file? (Of course that requires some planning on how to get the different dataelements when reading the file)
 
Tokelil said:
I have been thinking about kind of the same thing.

Would it be a bad idea to simple make an object with the data elements (or a struct) and simply writing that to a file? (Of course that requires some planning on how to get the different dataelements when reading the file)

Write them to a file, and seperate the elements with a special character, or hell, a carriage return. Then when you want a certain element, you already know how many special characters away it is, or how many lines... etc.

Wouldn't be that hard to do
 
If you use fixed length records (i.e. a structure with all the array sizes predetermined) then you can use perform random access on the file, by moving the file pointer by the size of the structure.

This is fine if what you are doing is fairly simple, but if you want to start searching on particular elements, or sorting by particular elements then you are better off going with a proper database.
That said it is always nice to have human readable text files which you can edit with a standard text editor.

Basically it all boils down to choosing the correct system for your intended usage.

CC
 
Back
Top