Organizing and searching individual records... how?

Discussion in 'PC Hardware, Software and Displays' started by zsouthboy, Jan 14, 2004.

  1. zsouthboy

    Regular

    Joined:
    Aug 1, 2003
    Messages:
    563
    Likes Received:
    9
    Location:
    Derry, NH
    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?
     
  2. Typedef Enum

    Regular

    Joined:
    Feb 10, 2002
    Messages:
    457
    Likes Received:
    0
    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.
     
  3. DarN

    Regular

    Joined:
    Jan 19, 2004
    Messages:
    406
    Likes Received:
    1
    Location:
    Norway
    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...
     
  4. zsouthboy

    Regular

    Joined:
    Aug 1, 2003
    Messages:
    563
    Likes Received:
    9
    Location:
    Derry, NH
    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. :)
     
  5. Tokelil

    Regular

    Joined:
    Mar 27, 2002
    Messages:
    329
    Likes Received:
    0
    Location:
    Denmark
    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)
     
  6. zsouthboy

    Regular

    Joined:
    Aug 1, 2003
    Messages:
    563
    Likes Received:
    9
    Location:
    Derry, NH
    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
     
  7. Captain Chickenpants

    Regular

    Joined:
    Feb 6, 2002
    Messages:
    446
    Likes Received:
    14
    Location:
    Kings Langley
    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
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...